Ejemplo n.º 1
0
 /**
  * Overrides base class to determine if the content has pxe context assigned, and if so
  * process it accordingly.  If the content element has a pxe tag (which would only be a span) then process the tag,
  * add the content, and close the tag.. otherwise just add the content normally
  * and let the pxe producer handle wrapping tags
  * @param IdmlContent $element
  * @param int $depth
  */
 public function visitContentEnd(IdmlContent $element, $depth = 0)
 {
     if (!$element->hasContent()) {
         //skip empty content tags
         return;
     }
     if (IdmlPxeHelper::hasPxeTag($element)) {
         parent::visitContentEnd($element, $depth);
         $this->closeElement($element, $depth);
     } elseif (IdmlPxeHelper::hasPxeParents($element)) {
         //get last parent and put this content inside it by assigning it
         $parents = IdmlPxeHelper::getPxeParents($element, true);
         if (count($parents) > 0) {
             parent::visitContentEnd($element, $depth);
             $this->closeElement($element, $depth);
         }
     } else {
         parent::visitContentEnd($element, $depth);
     }
 }