- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
while (count(array_diff(array_keys($rows), $roots)) > 0)
{
$theLeaves = $this->_getLeaves($rows);
foreach ($theLeaves as $leafId)
{
if(isset($rows[$rows[$leafId]['parent_id']]['Menu']['data']) and
!is_array($rows[$rows[$leafId]['parent_id']]['Menu']['data']))
if(!is_array($rows[$rows[$leafId]['parent_id']]['Menu']['data']))
unset($rows[$rows[$leafId]['parent_id']]['Menu']['data']);
if(isset($rows[$rows[$leafId]['parent_id']]['data']) and
!is_array($rows[$rows[$leafId]['parent_id']]['data']))
if(!is_array($rows[$rows[$leafId]['parent_id']]['data']))
unset($rows[$rows[$leafId]['parent_id']]['data']);
$rows[$rows[$leafId]['parent_id']]['data'][] = $rows[$leafId];
unset($rows[$leafId]);
}
}
пришел проектик на доработку. сижу, пытаюсь разобраться