protected function internalLoadModule($id, $force = false)
{
list($moduleClass, $initProperties, $configElement) = $this->_lazyModules[$id];
if (isset($initProperties['lazy']) && $initProperties['lazy'] && !$force) {
Prado::trace("Postponed loading of lazy module {$id} ({$moduleClass})", '\\Prado\\TApplication');
$this->setModule($id, null);
return null;
}
Prado::trace("Loading module {$id} ({$moduleClass})", '\\Prado\\TApplication');
$module = Prado::createComponent($moduleClass);
foreach ($initProperties as $name => $value) {
if ($name === 'lazy') {
continue;
}
$module->setSubProperty($name, $value);
}
$this->setModule($id, $module);
// keep the key to avoid reuse of the old module id
$this->_lazyModules[$id] = null;
return array($module, $configElement);
}