Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/Actions/Admin/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,10 @@ public function setSettings(): void
if (!empty(Theme::$current->settings['theme_variants'])) {
Utils::$context['theme_variants'] = [];

// Theme::loadVariant() offers a variant named 'default' alongside
// whatever the theme declares, so it belongs in this list too.
Theme::$current->settings['theme_variants'] = array_unique(array_merge(['default'], Theme::$current->settings['theme_variants']));

foreach (Theme::$current->settings['theme_variants'] as $variant) {
// Have any text, old chap?
Utils::$context['theme_variants'][$variant] = [
Expand Down
4 changes: 4 additions & 0 deletions Sources/Actions/ThemeChooser.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ public function execute(): void
eval(($matches[1] === '$' ? 'global $settings; ' : 'use SMF\\Theme; ') . $matches[0]);

if (!empty(Theme::$current->settings['theme_variants'])) {
// Theme::loadVariant() offers a variant named 'default' alongside
// whatever the theme declares, so it belongs in this list too.
Theme::$current->settings['theme_variants'] = array_unique(array_merge(['default'], Theme::$current->settings['theme_variants']));

foreach (Theme::$current->settings['theme_variants'] as $variant) {
Utils::$context['available_themes'][$id_theme]['variants'][$variant] = [
'label' => Lang::txtExists('variant_' . $variant) ? Lang::getTxt('variant_' . $variant) : $variant,
Expand Down