Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/themes_helper.php
Show First 20 Lines • Show All 588 Lines • ▼ Show 20 Line(s) | |||||
if (isset($theme_id)) { | if (isset($theme_id)) { | ||||
return $theme_id; | return $theme_id; | ||||
} | } | ||||
if ($this->Application->isAdmin) { | if ($this->Application->isAdmin) { | ||||
// get theme, that user selected in catalog | // get theme, that user selected in catalog | ||||
$theme_id = $this->Application->RecallVar('theme_id'); | $theme_id = $this->Application->RecallVar('theme_id'); | ||||
if ($theme_id === false) { | if ( $theme_id === false ) { | ||||
// query, because "m_theme" is always empty in admin | // Query, because "m_theme" is always empty in admin. | ||||
$id_field = $this->Application->getUnitOption('theme', 'IDField'); | $theme_id = $this->Application->GetDefaultThemeId(true); | ||||
$table_name = $this->Application->getUnitOption('theme', 'TableName'); | |||||
$sql = 'SELECT ' . $id_field . ' | |||||
FROM ' . $table_name . ' | |||||
WHERE (PrimaryTheme = 1) AND (Enabled = 1)'; | |||||
$theme_id = $this->Conn->GetOne($sql); | |||||
} | } | ||||
return $theme_id; | return $theme_id; | ||||
} | } | ||||
// use current theme, because it's available on Front-End | // use current theme, because it's available on Front-End | ||||
$theme_id = $this->Application->GetVar('m_theme'); | $theme_id = $this->Application->GetVar('m_theme'); | ||||
if (!$theme_id) { | if (!$theme_id) { | ||||
Show All 36 Lines |