Monday 19 December 2005 3:04:48 am
Sure, I was going to, but just forgot about it. There are two functions controlling the trash in trash.tpl:
1) Trash_count fetches the number of items in the trash (objects with status 2 in the ezcontentobject table). 2) Trash_object_list fetches the trashed objects (also status 2). The integer returned by trash_count is different compared to the number of objects returned by trash_object_list in version 3.4.8. The reason is that the trash_object_list function is based on each user while trash_count is based on the global trash. I can't come up with a reason why this is so, so I made trash_count function count only the trash objects of each user by editing the following in kernel/content/ezcontentfunctioncollection.php to the following:
function fetchTrashObjectCount()
{
$userID = ezUser::currentUserID();
$trashObjectList = &eZPersistentObject::fetchObjectList(
eZContentObject::definition(), array(),
array( 'status' => EZ_CONTENT_OBJECT_STATUS_ARCHIVED, 'owner_id' => $userID ),
array(), null, false,false,
array( array( 'operation' => 'count( * )',
'name' => 'count' ) ) );
return array( 'result' => $trashObjectList[0]['count'] );
}
/m
|