| @@ 457-467 (lines=11) @@ | ||
| 454 | ||
| 455 | foreach ($data as $category) { |
|
| 456 | if ($category['category_level'] == 1) { |
|
| 457 | if ($currentCategory != null) { |
|
| 458 | $return[] = array( |
|
| 459 | 'caption' => $currentCategory['display_name'], |
|
| 460 | 'active' => $match, |
|
| 461 | 'target' => '#', |
|
| 462 | 'subitems' => $currentData |
|
| 463 | ); |
|
| 464 | if ($match) { |
|
| 465 | $parentCategory = $currentCategory; |
|
| 466 | } |
|
| 467 | } |
|
| 468 | $currentData = array(); |
|
| 469 | $currentCategory = $category; |
|
| 470 | $match = false; |
|
| @@ 485-495 (lines=11) @@ | ||
| 482 | $match = $match || $localMatch; |
|
| 483 | } |
|
| 484 | } |
|
| 485 | if ($currentCategory != null) { |
|
| 486 | $return[] = array( |
|
| 487 | 'caption' => $currentCategory['display_name'], |
|
| 488 | 'active' => $match, |
|
| 489 | 'target' => '#', |
|
| 490 | 'subitems' => $currentData |
|
| 491 | ); |
|
| 492 | if ($match) { |
|
| 493 | $parentCategory = $currentCategory; |
|
| 494 | } |
|
| 495 | } |
|
| 496 | ||
| 497 | return array($return); |
|
| 498 | } |
|