Skip to content

Commit 3b322be

Browse files
committed
Site id parameter for theme list to set correct active theme for current site, excluded backup folder from site duplicate skip folders
1 parent 969a5ab commit 3b322be

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

admin/controller/theme/themes.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function duplicate() {
4141

4242
$srcDir = DIR_THEMES . $theme;
4343
$destDir = DIR_THEMES . $newSlug;
44-
$skipFolders = ['backup', 'src', 'node_modules', '.git'];
44+
$skipFolders = [/*'backup', */'src', 'node_modules', '.git'];
4545

4646
if ($dest) {
4747
if (file_exists($destDir)) {
@@ -128,7 +128,7 @@ function upload() {
128128
}
129129

130130
function index() {
131-
$themes = ThemesList :: getList();
131+
$themes = ThemesList :: getList($this->global['site_id']);
132132

133133
$this->view->themes = $themes;
134134
//$this->view->count = count($themes);
@@ -179,7 +179,7 @@ function import() {
179179
function activate() {
180180
$theme = $this->request->get['theme'];
181181

182-
if (Sites::setTheme($this->global['site_id'], $theme)) {
182+
if (Sites::setTheme($this->global['site_id'], $theme, 'index.html')) {
183183
$themeName = \Vvveb\humanReadable($theme);
184184
$this->themeActivateUrl = \Vvveb\url(['module' => 'theme/themes', 'action'=> 'import', 'theme' => $theme]);
185185
$successMessage = sprintf(__('Theme <b>%s</b> was activated!'), $themeName, $this->themeActivateUrl);

system/extensions/themes.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ static function getInfo($content, $name = false) {
4848
return $params;
4949
}
5050

51-
static function getList($path = '') {
52-
$activeTheme = Sites::getTheme() ?? 'default';
51+
static function getList($site_id = false) {
52+
$activeTheme = Sites::getTheme($site_id) ?? 'default';
5353
$list = glob(DIR_ROOT . '/public/themes/*/index.html');
5454

5555
$themes = [];

0 commit comments

Comments
 (0)