PluginProbe
Import WP – CSV & XML Import Export for WordPress / 2.7.14
Import WP – CSV & XML Import Export for WordPress v2.7.14
2.15.1 2.15.0 2.14.24 2.14.23 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 All 144 releases
jc-importer / class / Common / Importer / Preview / XMLNodePreview.php

XMLNodePreview.php in Import WP – CSV & XML Import Export for WordPress 2.7.14, at class/Common/Importer/Preview/XMLNodePreview.php

44 lines 939 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImportWP\Common\Importer\Preview;
4
5 use ImportWP\Common\Importer\File\XMLFile;
6 use ImportWP\Common\Importer\PreviewInterface;
7
8 class XMLNodePreview implements PreviewInterface
9 {
10
11 /**
12 * @var XMLFile $file
13 */
14 private $file;
15
16 /**
17 * XMLNodePreview constructor.
18 *
19 * @param \ImportWP\Common\Importer\File\XMLFile $file
20 * @param array $args
21 */
22 public function __construct(XMLFile $file, $args = array())
23 {
24 $this->file = $file;
25 }
26
27 /**
28 * Generate a list of possible XML Base nodes based on the XML data being previewed.
29 *
30 * @return string
31 */
32 public function output()
33 {
34 $output = '';
35 $nodes = $this->file->get_node_list();
36 if (!empty($nodes)) {
37 $output = implode('</li><li>', $nodes);
38 $output = '<li>' . $output . '</li>';
39 }
40
41 return '<ul>' . $output . '</ul>';
42 }
43 }
44