Пример #1
0
 public function __construct($out)
 {
     parent::__construct('dl', 'dt', ':', $out[0]);
     $element = new ListElement($this->level, 'dd');
     $this->last = Element::insert($element);
     if (!empty($out[1])) {
         $this->last = $this->last->insert(ElementFactory::factory('InlineElement', null, $out[1]));
     }
 }
Пример #2
0
 public function insert(&$obj)
 {
     $classname = get_class($this);
     if (!$obj instanceof $classname && $this->level > 3) {
         return $this->last = $this->last->insert($obj);
     }
     // Break if no elements found (BugTrack/524)
     if (count($obj->elements) === 1 && empty($obj->elements[0]->elements)) {
         return $this->last->parent;
     }
     // up to ListElement
     // Move elements
     foreach (array_keys($obj->elements) as $key) {
         parent::insert($obj->elements[$key]);
     }
     return $this->last;
 }
Пример #3
0
 public function insert(&$obj)
 {
     if (!is_object($obj)) {
         return;
     }
     // BugTrack/521, BugTrack/545
     if ($obj instanceof InlineElement) {
         return parent::insert($obj);
     }
     $class = get_class($this);
     if ($obj instanceof $class && $obj->level == $this->level && count($obj->elements)) {
         $obj =& $obj->elements[0];
         if ($this->last instanceof Paragraph && count($obj->elements)) {
             $obj =& $obj->elements[0];
         }
     }
     return parent::insert($obj);
 }
Пример #4
0
 public function insert(&$obj)
 {
     if ($obj instanceof InlineElement) {
         $obj = $obj->toPara();
     }
     return parent::insert($obj);
 }
Пример #5
0
 public function insert(&$obj)
 {
     parent::insert($obj);
     return $this->last =& $this;
 }