_categories = $categories; } private function _prepareCategories(){ foreach ($this->_categories as $key=>$category){ if($category['parent_id']==self::PARENT_ID){ $array = array(); $array = $category; $array['children'] = $this->_getChild($category); $array['count'] = count($array['children']); $array['totalCount'] = $this->_getChildTotalCount($array); array_push($this->_fmtCategories, $array); } } } private function _segmentColumns(){ foreach ($this->_fmtCategories as $key=>$fmtCategory){ $totalCount = $fmtCategory['totalCount']; if($totalCount<=self::SINGLE_COLUMN_VALUE){ $this->_fmtCategories[$key]['colNumber'] = 1; }else if($totalCount>self::SINGLE_COLUMN_VALUE&&$totalCount<=self::THREE_COLUMN_VALUE){ $this->_fmtCategories[$key]['colNumber'] = 2; }else if($totalCount>self::THREE_COLUMN_VALUE){ $this->_fmtCategories[$key]['colNumber'] = 3; } if($this->_fmtCategories[$key]['colNumber']>0){ $this->_fmtCategories[$key]['columns'] = $this->_getColumns($this->_fmtCategories[$key]); } } } private function _outputMenuHtml($categories){ $html = ''; $extra_class = ''; if($_GET['main_page']!=='index'||isset($_GET['cPath'])||isset($_GET['manufacturers_id'])){ $extra_class = ' hide not_main'; } else { $extra_class = ' '; } if(is_array($categories)&&!empty($categories)){ $html .='
'; } return $html; } private function _getChildHtml($columns,$basePath){ global $db; $html = ''; if(isset($columns)&&count($columns)>0){ $html .='