* Added alternate preprocessor implementation "Preprocessor_Hash" which uses plain...
[lhc/web/wiklou.git] / includes / Preprocessor_DOM.php
index 0cd9df3..c3ed83a 100644 (file)
@@ -588,6 +588,8 @@ class Preprocessor_DOM implements Preprocessor {
 class PPDStack {
        var $stack, $rootAccum, $top;
        var $out;
+       var $elementClass = 'PPDStackElement';
+       
        static $false = false;
 
        function __construct() {
@@ -614,10 +616,11 @@ class PPDStack {
        }
 
        function push( $data ) {
-               if ( $data instanceof PPDStackElement ) {
+               if ( $data instanceof $this->elementClass ) {
                        $this->stack[] = $data;
                } else {
-                       $this->stack[] = new PPDStackElement( $data );
+                       $class = $this->elementClass;
+                       $this->stack[] = new $class( $data );
                }
                $this->top = $this->stack[ count( $this->stack ) - 1 ];
                $this->accum =& $this->top->getAccum();
@@ -664,8 +667,11 @@ class PPDStackElement {
                $parts,             // Array of PPDPart objects describing pipe-separated parts.
                $lineStart;         // True if the open char appeared at the start of the input line. Not set for headings.
 
+       var $partClass = 'PPDPart';
+
        function __construct( $data = array() ) {
-               $this->parts = array( new PPDPart );
+               $class = $this->partClass;
+               $this->parts = array( new $class );
 
                foreach ( $data as $name => $value ) {
                        $this->$name = $value;
@@ -677,7 +683,8 @@ class PPDStackElement {
        }
 
        function addPart( $s = '' ) {
-               $this->parts[] = new PPDPart( $s );
+               $class = $this->partClass;
+               $this->parts[] = new $class( $s );
        }
 
        function getCurrentPart() {
@@ -733,7 +740,7 @@ class PPDPart {
 }
 
 /**
- * An expansion frame, used as a context to expand the result of preprocessToDom()
+ * An expansion frame, used as a context to expand the result of preprocessToObj()
  */
 class PPFrame_DOM implements PPFrame {
        var $preprocessor, $parser, $title;