Do not perform time consuming computations for building the menus if there are too many objects in a list (limit is configurable).

SVN:1.2.1[2343]
This commit is contained in:
Denis Flaven
2012-10-24 14:00:26 +00:00
parent 489c4c05e0
commit 71732f1722

View File

@@ -1181,7 +1181,8 @@ class MenuBlock extends DisplayBlock
$aStates = MetaModel::EnumStates($sClass);
// Do not perform time consuming computations if there are too may objects in the list
$iLimit = MetaModel::GetConfig()->Get('complex_actions_limit');
if (($iLimit > 0) && ($oSet->Count() < $iLimit) && (count($aStates) > 0))
if ((count($aStates) > 0) && (($iLimit == 0) || ($oSet->Count() < $iLimit)))
{
// Life cycle actions may be available... if all objects are in the same state
$oSet->Rewind();