Some cleanup
authorAlexander Ebert <ebert@woltlab.com>
Sat, 14 May 2016 22:07:28 +0000 (00:07 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 14 May 2016 22:07:28 +0000 (00:07 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php
wcfsetup/install/files/lib/system/html/output/HtmlOutputNodeProcessor.class.php [deleted file]
wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php [new file with mode: 0644]

index 412d814f12e30dd370283c7347d2a3097df55f9b..bdc000f0b6049f31f276e3bd24bc2a9f5fb98892 100644 (file)
@@ -81,17 +81,6 @@ class HtmlInputNodeWoltlabMetacode extends AbstractHtmlNode {
                                // attributes are invalid, remove element from DOM
                                DOMUtil::removeNode($element, true);
                        }
-                       
-                       
-                       continue;
-                       $parsedTag = HtmlBBCodeParser::getInstance()->getHtmlOutput($name, $attributes);
-                       
-                       $nodeIdentifier = StringUtil::getRandomID();
-                       $htmlNodeProcessor->addNodeData($this, $nodeIdentifier, [
-                               'parsedTag' => $parsedTag
-                       ]);
-                       
-                       $htmlNodeProcessor->renameTag($metacode, 'wcfNode-' . $nodeIdentifier);
                }
        }
        
diff --git a/wcfsetup/install/files/lib/system/html/output/HtmlOutputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/HtmlOutputNodeProcessor.class.php
deleted file mode 100644 (file)
index 91b7139..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-namespace wcf\system\html\output;
-use wcf\system\html\node\HtmlNodeProcessor;
-use wcf\system\html\output\node\HtmlOutputNodeBlockquote;
-use wcf\system\html\output\node\HtmlOutputNodeWoltlabMention;
-
-/**
- * TOOD documentation
- * @since      2.2
- */
-class HtmlOutputNodeProcessor extends HtmlNodeProcessor {
-       public function process() {
-               // TODO: this should be dynamic to some extent
-               $this->invokeHtmlNode(new HtmlOutputNodeBlockquote());
-               $this->invokeHtmlNode(new HtmlOutputNodeWoltlabMention());
-       }
-}
index c9774151d3cf88d457f7183e705a8a15632f59ed..d9f12d073375cf63388af4953a3ffafc62666bd0 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\html\output;
+use wcf\system\html\output\node\HtmlOutputNodeProcessor;
 
 /**
  * TOOD documentation
@@ -11,14 +12,18 @@ class HtmlOutputProcessor {
         */
        protected $htmlOutputNodeProcessor;
        
-       public function __construct(HtmlOutputNodeProcessor $htmlOutputNodeProcessor) {
-               $this->htmlOutputNodeProcessor = $htmlOutputNodeProcessor;
+       public function process($html) {
+               $this->getHtmlOutputNodeProcessor()->load($html);
+               $this->getHtmlOutputNodeProcessor()->process();
+               
+               return $this->getHtmlOutputNodeProcessor()->getHtml();
        }
        
-       public function process($html) {
-               $this->htmlOutputNodeProcessor->load($html);
-               $this->htmlOutputNodeProcessor->process();
+       protected function getHtmlOutputNodeProcessor() {
+               if ($this->htmlOutputNodeProcessor === null) {
+                       $this->htmlOutputNodeProcessor = new HtmlOutputNodeProcessor();
+               }
                
-               return $this->htmlOutputNodeProcessor->getHtml();
+               return $this->htmlOutputNodeProcessor;
        }
 }
diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
new file mode 100644 (file)
index 0000000..65794ba
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+namespace wcf\system\html\output\node;
+use wcf\system\html\node\HtmlNodeProcessor;
+
+/**
+ * TOOD documentation
+ * @since      2.2
+ */
+class HtmlOutputNodeProcessor extends HtmlNodeProcessor {
+       public function process() {
+               // TODO: this should be dynamic to some extent
+               $this->invokeHtmlNode(new HtmlOutputNodeBlockquote());
+               $this->invokeHtmlNode(new HtmlOutputNodeWoltlabMention());
+       }
+}