Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -r8993 -r9001 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 8993) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 9001) @@ -14,7 +14,21 @@ } return $object->GetDBField('CachedDescendantCatsQty'); + } + /** + * Returns category count in system + * + * @param Array $params + * @return int + */ + function CategoryCount($params) + { + $count_helper =& $this->Application->recallObject('CountHelper'); + /* @var $count_helper kCountHelper */ + + $today_only = isset($params['today']) && $params['today']; + return $count_helper->CategoryCount($today_only); } function IsNew($params) @@ -66,12 +80,10 @@ $cat_object =& $this->getObject($params); $ci_table = $this->Application->getUnitOption('l-ci', 'TableName'); - $sql = ' SELECT COUNT(*) - FROM '.$cat_object->TableName.' c - LEFT JOIN '.$ci_table.' ci - ON c.CategoryId=ci.CategoryId - WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%" - AND NOT (ci.CategoryId IS NULL)'; + $sql = 'SELECT COUNT(*) + FROM '.$cat_object->TableName.' c + LEFT JOIN '.$ci_table.' ci ON c.CategoryId=ci.CategoryId + WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%" AND NOT (ci.CategoryId IS NULL)'; return $this->Conn->GetOne($sql); } @@ -571,9 +583,7 @@ $object =& $this->getObject($params); /* @var $object kDBList */ - $params['_subcats'] = 1; - $params['_countcurrent'] = 1; - $params['_catid'] = $object->GetID(); + $params['cat_id'] = $object->GetID(); $count_helper =& $this->Application->recallObject('CountHelper'); /* @var $count_helper kCountHelper */