Application->siteDomainField('PrimaryThemeId'); if (!$id) { $id = 1; $id_field_name = 'PrimaryTheme'; } $default = true; } $res = parent::Load($id, $id_field_name, $cachable); if ($res) { $available_themes = $this->Application->siteDomainField('Themes'); if ($available_themes) { if (strpos($available_themes, '|' . $this->GetID() . '|') === false) { // theme isn't allowed in site domain return $this->Clear(); } } } if ($default) { if (!$res) { if ($this->Application->isAdmin) { $res = parent::Load(1, $id_field_name, false); } } $this->Application->SetVar('theme.current_id', $this->GetID() ); $this->Application->SetVar('m_theme', $this->GetID() ); } return $res; } }