private function PackageTree($category, $def_IDS) { $expanded = false; $checked = ''; if ($def_IDS != null) { foreach ($def_IDS as $ID) { if ($category['category_ID'] == $ID) { $checked = 'checked="true"'; $expanded = true; } } } if ($children = category_entity::getChirdren($category['category_ID'])) { foreach ($children as $key => $row) { $begats[] = $this->PackageTree($row, $def_IDS); if ($begats[$key]['expanded']) { $expanded = true; } } $node = array('text' => "<input name='discount[discount_category_ID][]' {$checked} type='checkbox' value='{$category['category_ID']}' />{$category['category_name']}", 'expanded' => $expanded, 'hasChildren' => true, 'children' => $begats); } else { $node = array('text' => "<input name='discount[discount_category_ID][]' {$checked} type='checkbox' value='{$category['category_ID']}' /> {$category['category_name']}", 'expanded' => $expanded); } return $node; }
<div id="navigate"> <a href="/" class="n_home">Home</a> - <span>All Categories</span> <span class="n_icol"></span> <span class="n_icor"></span> </div> <div class="content_box mb_12 all_categories"> <div class="pop_box" style="padding:12px;"> <h1>All Categories</h1> <?php foreach ($roots as $row) { echo "<h2><a href='/{$row['category_SEF']}'>{$row['category_name']}</a></h2> <ul class='nav1'>"; foreach (category_entity::getChirdren($row['category_ID']) as $item) { echo "<li><a href='/{$item['category_SEF']}'>{$item['category_name']}</a></li>"; } echo " </ul><div class='fix'></div>"; } ?> </div> </div> <div class="content_box mb_12 prduct_list" id="popular"> <h2><a href="#popular" class="i_d_sel">Popular Products</a></h2> <?php /* $pop=product_entity::model()->popular()->findAll(); $count=count($pop); foreach($pop as $key=>$row) {
?> </div> <div id="footer"> <div class="footer_link"> <a href="/help/about" rel="nofollow">About Us</a> <a href="/help/shipping" rel="nofollow">Shipping & Tracking</a> <a href="/help/return" rel="nofollow">Return & Exchanges</a> <a href="/help/privacy" rel="nofollow">Privacy Policy</a> <a href="/help/terms" rel="nofollow">Terms & Conditions</a> <a href="/help/contact" rel="nofollow">Contact Us</a> <a href="/sitemap.xml" rel="nofollow">Sitemap</a> <a href="#page_top" class="back_top" rel="nofollow">TOP</a> </div> <?php foreach (category_entity::getChirdren(1) as $row) { $cate .= "<li><a href='/{$row['category_SEF']}'>{$row['category_name']}</a></li>"; } ?> <ul class="nav4"> <?php echo $cate; ?> </ul> <div class="fix"></div> <div class="footer_copyr"> © 2000-2010 Cardsnds Inc. All rights reserved. </div> </div> <!--/footer --> <img src="/images/f_secure_img.jpg" alt="" /> </div>
<ul> <?php $roots = category_entity::rootCategory(); if (!isset($this->acc_active)) { $active_index = 0; } else { $active_index = $this->acc_active; } $i = 0; foreach ($roots as $value) { if ($i == $active_index) { $active = "sc_currall"; } else { $active = null; } $children = category_entity::getChirdren($value['category_ID']); echo "<li><h3 class='{$active}'><a href='/{$value['category_SEF']}'>{$value['category_name']}</a></h3>"; echo "<ul style='display:block;'>"; foreach ($children as $item) { echo "<li><a href='/{$item['category_SEF']}'>{$item['category_name']}</a></li>"; } echo "</ul></li>"; $i++; } ?> </ul> </div> <div class="fix"></div> </div>
private function PackageTree($category, $def_ID) { if ($category['category_ID'] == $def_ID) { $checked = "<img src='{$this->module->registerImage('fam_bullet_success.gif')}' alt='success' />"; $expanded = true; } else { $expanded = false; $checked = ''; } if ($children = category_entity::getChirdren($category['category_ID'])) { foreach ($children as $key => $row) { $begats[] = $this->PackageTree($row, $def_ID); if ($begats[$key]['expanded']) { $expanded = true; } } $node = array('text' => "id:{$category['category_ID']}<a href='/dashboard/category/update/id/{$category['category_ID']}'>{$category['category_name']}</a>{$checked}", 'expanded' => $expanded, 'hasChildren' => true, 'children' => $begats); } else { $node = array('text' => "id:{$category['category_ID']}<a href='/dashboard/category/update/id/{$category['category_ID']}'>{$category['category_name']}</a>{$checked}", 'expanded' => $expanded); } return $node; }