  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: category_tree.php 686 2006-08-14 22:33:22Z hpdl $ |
| |
| 3 | + | $Id: category_tree.php 733 2006-08-20 15:32:32Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
235 | 235 | | return false; |
| |
236 | 236 | | } |
| |
237 | 237 | | |
  |
| 238 | + | function getChildren($category_id, &$array) { |
| |
| 239 | + | foreach ($this->data as $parent => $categories) { |
| |
| 240 | + | if ($parent == $category_id) { |
| |
| 241 | + | foreach ($categories as $id => $info) { |
| |
| 242 | + | $array[] = $id; |
| |
| 243 | + | $this->getChildren($id, $array); |
| |
| 244 | + | } |
| |
| 245 | + | } |
| |
| 246 | + | } |
| |
| 247 | + | |
| |
| 248 | + | return $array; |
| |
| 249 | + | } |
| |
| 250 | + | |
  |
238 | 251 | | function getData($id) { |
| |
239 | 252 | | foreach ($this->data as $parent => $categories) { |
| |
240 | 253 | | foreach ($categories as $category_id => $info) { |