PluginProbe
E2Pdf – Export Pdf Tool for WordPress / 1.07.11
E2Pdf – Export Pdf Tool for WordPress v1.07.11
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.07.11, at classes/extension/e2pdf-wordpress.php

742 lines 26.8 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 if (!$this->helper->load('image')->get_image($value)) {
404 $value = $this->strip_shortcodes($value);
405 if (
406 $value &&
407 trim($value) != "" &&
408 extension_loaded('gd') &&
409 function_exists('imagettftext')
410 ) {
411 if (isset($field['properties']['text_color']) && $field['properties']['text_color']) {
412 $penColour = $this->helper->load('convert')->to_hex_color($field['properties']['text_color']);
413 } else {
414 $penColour = array(0x14, 0x53, 0x94);
415 }
416
417 $default_options = array(
418 'imageSize' => array(isset($field['width']) ? $field['width'] : '400', isset($field['height']) ? $field['height'] : '150'),
419 'bgColour' => 'transparent',
420 'penColour' => $penColour
421 );
422
423 $options = array();
424 $options = apply_filters('e2pdf_image_sig_output_options', $options, $element_id, $template_id);
425 $options = array_merge($default_options, $options);
426
427 $model_e2pdf_font = new Model_E2pdf_Font();
428
429 $font = false;
430 if (isset($field['properties']['text_font']) && $field['properties']['text_font']) {
431 $font = $model_e2pdf_font->get_font_path($field['properties']['text_font']);
432 }
433 if (!$font) {
434 $font = $model_e2pdf_font->get_font_path('Noto Sans');
435 }
436
437 $size = 150;
438 if (isset($field['properties']['text_font_size']) && $field['properties']['text_font_size']) {
439 $size = $field['properties']['text_font_size'];
440 }
441
442 $model_e2pdf_signature = new Model_E2pdf_Signature();
443 $value = $model_e2pdf_signature->ttf_signature($value, $size, $font, $options);
444 } else {
445 $value = "";
446 }
447 }
448 }
449 } else {
450 $value = $this->convert_shortcodes($value);
451 }
452 }
453
454 $value = apply_filters('e2pdf_extension_render_shortcodes_value', $value, $element_id, $template_id, $item, $dataset);
455
456 return $value;
457 }
458
459 public function filter_custom_shortcodes() {
460
461 }
462
463 /**
464 * Strip unused shortcodes
465 *
466 * @param string $value - Content
467 *
468 * @return string - Value with removed unused shortcodes
469 */
470 public function strip_shortcodes($value) {
471 $value = preg_replace('~(?:\[/?)[^/\]]+/?\]~s', "", $value);
472 return $value;
473 }
474
475 /**
476 * Convert "shortcodes" inside value string
477 *
478 * @param string $value - Value string
479 * @param bool $to - Convert From/To
480 *
481 * @return string - Converted value
482 */
483 public function convert_shortcodes($value, $to = false) {
484 if ($value) {
485 if ($to) {
486 $value = str_replace("&#91;", "[", $value);
487 } else {
488 $value = str_replace("[", "&#91;", $value);
489 }
490 }
491 return $value;
492 }
493
494 public function auto() {
495 $response = array();
496 $elements = array();
497
498 $post = $this->get('item');
499
500 $elements[] = array(
501 'type' => 'e2pdf-html',
502 'block' => true,
503 'properties' => array(
504 'top' => '20',
505 'left' => '20',
506 'right' => '20',
507 'width' => '100%',
508 'height' => 'auto',
509 'value' => "<h1>[post_title]</h1>",
510 )
511 );
512
513 $elements[] = array(
514 'type' => 'e2pdf-html',
515 'block' => true,
516 'properties' => array(
517 'top' => '20',
518 'left' => '20',
519 'right' => '20',
520 'width' => '100%',
521 'height' => 'auto',
522 'value' => __("Post name", 'e2pdf') . ": [post_name]",
523 )
524 );
525
526 $elements[] = array(
527 'type' => 'e2pdf-html',
528 'block' => true,
529 'properties' => array(
530 'top' => '20',
531 'left' => '20',
532 'right' => '20',
533 'width' => '100%',
534 'height' => 'auto',
535 'value' => __("Post type", 'e2pdf') . ": [post_type]",
536 )
537 );
538
539
540 $elements[] = array(
541 'type' => 'e2pdf-html',
542 'block' => true,
543 'properties' => array(
544 'top' => '20',
545 'left' => '20',
546 'right' => '20',
547 'width' => '100%',
548 'height' => 'auto',
549 'value' => __("ID", 'e2pdf') . ": [id]",
550 )
551 );
552
553 $elements[] = array(
554 'type' => 'e2pdf-html',
555 'block' => true,
556 'properties' => array(
557 'top' => '20',
558 'left' => '20',
559 'right' => '20',
560 'width' => '100%',
561 'height' => 'auto',
562 'value' => __("Author", 'e2pdf') . ": [post_author]",
563 )
564 );
565
566 $elements[] = array(
567 'type' => 'e2pdf-html',
568 'block' => true,
569 'properties' => array(
570 'top' => '20',
571 'left' => '20',
572 'right' => '20',
573 'width' => '100%',
574 'height' => '300',
575 'value' => "[post_content]",
576 'dynamic_height' => '1',
577 )
578 );
579
580 $elements[] = array(
581 'type' => 'e2pdf-html',
582 'block' => true,
583 'properties' => array(
584 'top' => '20',
585 'left' => '20',
586 'right' => '20',
587 'width' => '100%',
588 'height' => 'auto',
589 'value' => __("Created", 'e2pdf') . ": [post_date]",
590 )
591 );
592
593 $elements[] = array(
594 'type' => 'e2pdf-html',
595 'block' => true,
596 'properties' => array(
597 'top' => '20',
598 'left' => '20',
599 'right' => '20',
600 'width' => '100%',
601 'height' => 'auto',
602 'value' => __("Modified", 'e2pdf') . ": [post_modified]",
603 )
604 );
605
606 $response['page'] = array(
607 'bottom' => '20',
608 'top' => '20',
609 'left' => '20',
610 'right' => '20'
611 );
612
613 $response['elements'] = $elements;
614 return $response;
615 }
616
617 /**
618 * Search and update shortcodes for this extension inside content
619 * Auto set of dataset id
620 *
621 * @param string $content - Content
622 * @param string $post_id - Custom Post ID
623 *
624 * @return string - Content with updated shortcodes
625 */
626 public function filter_content($content, $post_id = false) {
627 global $post;
628
629 if (false === strpos($content, '[')) {
630 return $content;
631 }
632
633 $shortcode_tags = array(
634 'e2pdf-download',
635 'e2pdf-view'
636 );
637
638 preg_match_all('@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches);
639 $tagnames = array_intersect($shortcode_tags, $matches[1]);
640
641 if (!empty($tagnames)) {
642
643 $pattern = $this->helper->load('shortcode')->get_shortcode_regex($tagnames);
644
645 preg_match_all("/$pattern/", $content, $shortcodes);
646
647 foreach ($shortcodes[0] as $key => $shortcode_value) {
648
649 wp_reset_postdata();
650
651 $shortcode = array();
652 $shortcode[1] = $shortcodes[1][$key];
653 $shortcode[2] = $shortcodes[2][$key];
654 $shortcode[3] = $shortcodes[3][$key];
655 $shortcode[4] = $shortcodes[4][$key];
656 $shortcode[5] = $shortcodes[5][$key];
657 $shortcode[6] = $shortcodes[6][$key];
658
659 $atts = shortcode_parse_atts($shortcode[3]);
660
661 if (!isset($atts['dataset']) && isset($atts['id'])) {
662 $template = new Model_E2pdf_Template();
663 $template->load($atts['id']);
664 if ($template->get('extension') === 'wordpress') {
665 if ($post_id || isset($post->ID)) {
666 $dataset = $post_id ? $post_id : $post->ID;
667 $atts['dataset'] = $dataset;
668 $shortcode[3] .= " dataset=\"{$dataset}\"";
669 }
670 }
671 }
672 $content = str_replace($shortcode_value, do_shortcode_tag($shortcode), $content);
673 }
674 }
675
676 return $content;
677 }
678
679 /**
680 * Verify if item and dataset exists
681 *
682 * @return bool - item and dataset exists
683 */
684 public function verify() {
685 $item = $this->get('item');
686 $dataset = $this->get('dataset');
687
688 if ($item && $dataset && get_post($dataset) && $item == get_post_type($dataset)) {
689 return true;
690 }
691
692 return false;
693 }
694
695 /**
696 * Init Visual Mapper data
697 *
698 * @return bool|string - HTML data source for Visual Mapper
699 */
700 public function visual_mapper() {
701
702 $vc = "<h3>Wordpress</h3>";
703 $vc .= "<div class='e2pdf-grid'>";
704 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("ID", "e2pdf"), 'id')}</div>";
705 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Author", "e2pdf"), 'post_author')}</div>";
706 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Date", "e2pdf"), 'post_date')}</div>";
707 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Date (GMT)", "e2pdf"), 'post_date_gmt')}</div>";
708 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Content", "e2pdf"), 'post_content')}</div>";
709 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Title", "e2pdf"), 'post_title')}</div>";
710 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Excerpt", "e2pdf"), 'post_excerpt')}</div>";
711 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Status", "e2pdf"), 'post_status')}</div>";
712 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Comment Status", "e2pdf"), 'comment_status')}</div>";
713 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Ping Status", "e2pdf"), 'ping_status')}</div>";
714 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Post Password", "e2pdf"), 'post_password')}</div>";
715 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Post Name", "e2pdf"), 'post_name')}</div>";
716 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("To Ping", "e2pdf"), 'to_ping')}</div>";
717 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Ping", "e2pdf"), 'pinged')}</div>";
718 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Modified Date", "e2pdf"), 'post_modified')}</div>";
719 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Modified Date (GMT)", "e2pdf"), 'post_modified_gmt')}</div>";
720 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Filtered Content", "e2pdf"), 'post_content_filtered')}</div>";
721 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Parent ID", "e2pdf"), 'post_parent')}</div>";
722 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("GUID", "e2pdf"), 'guid')}</div>";
723 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Menu Order", "e2pdf"), 'menu_order')}</div>";
724 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Type", "e2pdf"), 'post_type')}</div>";
725 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Mime Type", "e2pdf"), 'post_mime_type')}</div>";
726 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Comments Count", "e2pdf"), 'comment_count')}</div>";
727 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Filter", "e2pdf"), 'filter')}</div>";
728 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Post Thumbnail", "e2pdf"), 'post_thumbnail')}</div>";
729 $vc .= "</div>";
730 return $vc;
731 }
732
733 private function get_vm_element($name, $id) {
734 $element = "<div>";
735 $element .= "<label>{$name}:</label>";
736 $element .= "<input type='text' name='[{$id}]' value='[{$id}]' class='e2pdf-w100'>";
737 $element .= "</div>";
738 return $element;
739 }
740
741 }
742