Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); /* $prefix_special = $this->getPrefixSpecial(); if ( !($list->OriginalParams == $params) ) { $this->Application->removeObject($prefix_special); $list =& $this->Application->recallObject($prefix_special,$this->Prefix.'_List',$params); } */ $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); $list->PerPage=-1; $list->Query(); $o = ''; $list->GoFirst(); $block_params=$this->prepareTagParams($params); $block_params['name']=$params['block']; $block_params['pass_params']='true'; $block_params['IdField'] = $id_field; while (!$list->EOL()) { $stored_cat=$this->Application->RecallVar("StoredRootCatId", ""); if ($stored_cat!=""){ $list->Records[$list->CurrentIndex]["RootCat"]=$stored_cat; } $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); $o.= $this->Application->ParseBlock($block_params, 1); $list->GoNext(); } $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); $this->Application->RemoveVar("StoredRootCatId"); return $o; } function CategoryPath($params) { $object=&$this->Application->recallObject("confg"); $root_cat=$object->GetDBField("RootCat"); if (!isset($params['cat_id'])){ $stored_cat=$this->Application->RecallVar("StoredRootCatId", ""); if ($stored_cat){ $params['cat_id'] = $stored_cat; }else{ $params['cat_id'] = $root_cat; } } $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 '.TABLE_PREFIX.'Category WHERE CategoryId='.$params['cat_id']; $res = $this->Conn->GetRow($sql); if ($res === false) { // in case if category is deleted return ''; } $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); } } function SaveWarning($params) { $object=&$this->Application->recallObject($this->getPrefixSpecial()); $root_cat=$object->GetDBField("RootCat"); $stored_cat=$this->Application->RecallVar("StoredRootCatId", ""); if ($stored_cat!="" && $stored_cat!=$root_cat){ return $this->Application->ParseBlock($params); } return ""; } function AllowAffiliateRegistration($params) { return $this->Application->ConfigValue('Comm_RegisterAsAffiliate') ? 1 : 0; } } ?>