function Insert($item, $parent = null, $previous = null)
    {
        if ($previous)
        {
            $parent = $this->provider->ParentOf($previous);
        }
        $oldNext = $this->provider->NextOf($item);
        $oldPrev = $this->provider->PreviousOf($item);
        $oldFirst = $this->provider->FirstChildOf($parent);
        if (!($oldPrev && $previous && $this->provider->Equals($oldPrev, $previous)))
        {
            $this->CloseCutGap($oldPrev, $oldNext, $item);
        }
        $this->UpdateInsertItem($item, $parent, $previous);
        
        if (!$previous)
        {
            $this->AssureFirstChild($item, $oldFirst);
        }
    }
function Insert($item, $parent = null, $previous = null)
    {
        if ($previous)
        {
            $parent = $this->provider->ParentOf($previous);
        }
        $oldNext = $this->provider->NextOf($item);
        $oldPrev = $this->provider->PreviousOf($item);
        $oldFirst = $this->provider->FirstChildOf($parent);
        if (!($oldPrev && $previous && $this->provider->Equals($oldPrev, $previous)))
        {
            $this->CloseCutGap($oldPrev, $oldNext, $item);
        }
        $this->UpdateInsertItem($item, $parent, $previous);
        
        if (!$previous)
        {
            $this->AssureFirstChild($item, $oldFirst);
        }
    }
function Insert ( $ item , $ parent = null , $ previous = null ) { if ( $ previous ) { $ parent = $ this -> provider -> ParentOf ( $ previous ) ; } $ oldNext = $ this -> provider -> NextOf ( $ item ) ; $ oldPrev = $ this -> provider -> PreviousOf ( $ item ) ; $ oldFirst = $ this -> provider -> FirstChildOf ( $ parent ) ; if ( ! ( $ oldPrev && $ previous && $ this -> provider -> Equals ( $ oldPrev , $ previous ) ) ) { $ this -> CloseCutGap ( $ oldPrev , $ oldNext , $ item ) ; } $ this -> UpdateInsertItem ( $ item , $ parent , $ previous ) ; if ( ! $ previous ) { $ this -> AssureFirstChild ( $ item , $ oldFirst ) ; } }
Inserts the item
@param mixed $item
@param mixed $parent
@param mixed $previous
Inserts the item