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[2341]
This commit is contained in:
Denis Flaven
2012-10-24 13:48:20 +00:00
parent f65e18400d
commit 489c4c05e0
2 changed files with 12 additions and 1 deletions

View File

@@ -1179,7 +1179,9 @@ class MenuBlock extends DisplayBlock
// Stimuli
$aStates = MetaModel::EnumStates($sClass);
if (count($aStates) > 0)
// 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))
{
// Life cycle actions may be available... if all objects are in the same state
$oSet->Rewind();

View File

@@ -471,6 +471,15 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => true,
),
'complex_actions_limit' => array(
'type' => 'integer',
'description' => 'Display the "actions" menu items that require long computation only if the list of objects is contains less objects than this number (0 means no limit)',
// examples... not used
'default' => 50,
'value' => 50,
'source_of_value' => '',
'show_in_conf_sample' => false,
),
);
public function IsProperty($sPropCode)