Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); $cat_id = $this->Application->GetVar('m_cat_id') ? $this->Application->GetVar('m_cat_id') : 0; $list->SetWhereClause( 'ParentId='.$this->Application->GetVar('m_cat_id') ); $list->Query(); $o = ''; $list->GoFirst(); $block_params=$this->prepareTagParams($params); $block_params['name']=$params['block']; $block_params['pass_params']='true'; while (!$list->EOL()) { $block_params['cat_id'] = $list->GetDBField('CategoryId'); $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET $o.= $this->Application->ParseBlock($block_params, 1); $list->GoNext(); } $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); return $o; } function RootCategoryName($params) { $root_phrase = $this->Application->ConfigValue('Root_Name'); $ret = $this->Application->Phrase($root_phrase); return $ret; } function CategoryPath($params) { if(!isset($params['cat_id'])) { $params['cat_id'] = $this->Application->GetVar('m_cat_id'); $block_params['current'] = 1; } $block_params['separator'] = $params['separator']; if($params['cat_id'] == 0) { $block_params['name'] = $params['rootcatblock']; return $this->Application->ParseBlock($block_params); } else { $cat_object = $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' ); $sql = 'SELECT CategoryId, ParentId, Name FROM '.$cat_object->TableName.' WHERE CategoryId='.$params['cat_id']; $res = $this->Conn->GetRow($sql); $block_params['name'] = $params['block']; $block_params['cat_name'] = $res['Name']; $block_params['separator'] = $params['separator']; $block_params['cat_id'] = $res['CategoryId']; $next_params['separator'] = $params['separator']; $next_params['rootcatblock'] = $params['rootcatblock']; $next_params['block'] = $params['block']; $next_params['cat_id'] = $res['ParentId']; return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params); } } } ?>