Index: trunk/core/units/general/cat_tag_processor.php =================================================================== diff -u -r5214 -r5219 --- trunk/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 5214) +++ trunk/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 5219) @@ -1,28 +1,28 @@ Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params); - + $grids = $this->Application->getUnitOption($this->Prefix,'Grids'); $icons =& $grids[ $params['grid'] ]['Icons']; - + $status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField'); if (!$status_fields) return $icons['default']; - + $value = $object->GetDBField($status_fields[0]); // sets base status icon if ($value == STATUS_ACTIVE) { if( $object->GetDBField('IsPop') ) $value = 'POP'; if( $object->GetDBField('IsHot') ) $value = 'HOT'; if( $object->GetDBField('IsNew') ) $value = 'NEW'; if( $object->GetDBField('EditorsPick') ) $value = 'PICK'; } - + return isset($icons[$value]) ? $icons[$value] : $icons['default']; } - + /** * Returns path where exported category items should be saved * @@ -36,19 +36,19 @@ { $ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret); } - + $export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options')); $ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml'); - + return $ret; } - + function CategoryPath($params) { if (!isset($params['cat_id'])) { $params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0); } - + $block_params['separator'] = $params['separator']; if ($params['cat_id'] == 0) { @@ -66,18 +66,18 @@ // in case if category is deleted return ''; } - $block_params['name'] = $params['block']; + $block_params['name'] = $params['block']; $block_params['cat_name'] = $res['Name']; $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 BuildListSpecial($params) { if ($this->Special != '') return $this->Special; @@ -90,47 +90,60 @@ $parent_cat_id = $this->Application->GetVar('m_cat_id'); } } - + $recursive = isset($params['recursive']); - + $types = $this->SelectParam($params, 'types'); $except = $this->SelectParam($params, 'except'); - + if ($types.$except.$recursive == '') { return parent::BuildListSpecial($params); } - + $special = crc32($parent_cat_id.$types.$except.$recursive); return $special; } - + function ExportStatus($params) { $export_object =& $this->Application->recallObject('CatItemExportHelper'); $event = new kEvent($this->getPrefixSpecial().':OnDummy'); - + $action_method = 'perform'.ucfirst($this->Special); $field_values = $export_object->$action_method($event); - + // finish code is done from JS now if ($field_values['start_from'] == $field_values['total_records']) { if ($this->Special == 'import') { $this->Application->StoreVar('PermCache_UpdateRequired', 1); } } - + $export_options = $export_object->loadOptions($event); return $export_options['start_from'] * 100 / $export_options['total_records']; } - + function CatalogItemCount($params) { $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List', $params); return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount; } - + + function ListReviews($params) + { + $prefix = $this->Prefix.'-rev'; + $review_tag_processor =& $this->Application->recallObject($prefix.'.item_TagProcessor'); + return $review_tag_processor->PrintList($params); + } + + function ReviewCount($params) + { + $review_tag_processor =& $this->Application->recallObject('rev.item_TagProcessor'); + return $review_tag_processor->TotalRecords($params); + } + } ?> \ No newline at end of file