private function _addTocSubEntry($depth, $level, $title, $identifier, &$list)
    {
        if (!isset($list['sub']))
            $list['sub'] = array();
        $offset = count($list['sub']);
        if ($depth === 1) {
            $list['sub'][$offset] = array(
                'id' => $identifier,
                'value' => $title
            );
            return;
        }
        $offset--;
        if (!isset($list['sub'][$offset]))
            $list['sub'][$offset] = array();
        $this->_addTocSubEntry($depth - 1, $level, $title, $identifier, $list['sub'][$offset]);
    }
private function _addTocSubEntry($depth, $level, $title, $identifier, &$list)
    {
        if (!isset($list['sub']))
            $list['sub'] = array();
        $offset = count($list['sub']);
        if ($depth === 1) {
            $list['sub'][$offset] = array(
                'id' => $identifier,
                'value' => $title
            );
            return;
        }
        $offset--;
        if (!isset($list['sub'][$offset]))
            $list['sub'][$offset] = array();
        $this->_addTocSubEntry($depth - 1, $level, $title, $identifier, $list['sub'][$offset]);
    }
private function _addTocSubEntry ( $ depth , $ level , $ title , $ identifier , & $ list ) { if ( ! isset ( $ list [ 'sub' ] ) ) $ list [ 'sub' ] = array ( ) ; $ offset = count ( $ list [ 'sub' ] ) ; if ( $ depth === 1 ) { $ list [ 'sub' ] [ $ offset ] = array ( 'id' => $ identifier , 'value' => $ title ) ; return ; } $ offset -- ; if ( ! isset ( $ list [ 'sub' ] [ $ offset ] ) ) $ list [ 'sub' ] [ $ offset ] = array ( ) ; $ this -> _addTocSubEntry ( $ depth - 1 , $ level , $ title , $ identifier , $ list [ 'sub' ] [ $ offset ] ) ; }
Add a sub-TOC entry.
@param    int $depth Depth in the tree.
@param    int $level Level of the title.
@param    string $title Name of the new entry.
@param    string $identifier Identifier of the new entry.
@param    array $list List of sibbling nodes.
Add a sub - TOC entry .