protected function initRecursive($namingContainer = null)
{
$this->ensureChildControls();
if ($this->getHasControls()) {
if ($this instanceof INamingContainer) {
$namingContainer = $this;
}
$page = $this->getPage();
foreach ($this->_rf[self::RF_CONTROLS] as $control) {
if ($control instanceof TControl) {
$control->_namingContainer = $namingContainer;
$control->_page = $page;
if ($control->_id === '' && $namingContainer) {
$control->generateAutomaticID();
}
$control->initRecursive($namingContainer);
}
}
}
if ($this->_stage < self::CS_INITIALIZED) {
$this->_stage = self::CS_CHILD_INITIALIZED;
if (($page = $this->getPage()) && $this->getEnableTheming() && !($this->_flags & self::IS_SKIN_APPLIED)) {
$page->applyControlSkin($this);
$this->_flags |= self::IS_SKIN_APPLIED;
}
if (isset($this->_rf[self::RF_ADAPTER])) {
$this->_rf[self::RF_ADAPTER]->onInit(null);
} else {
$this->onInit(null);
}
$this->_stage = self::CS_INITIALIZED;
}
}