Skip to content

Commit

Permalink
fix #354 cannot switch theme in thememagick
Browse files Browse the repository at this point in the history
  • Loading branch information
joomlart committed Jun 10, 2015
1 parent 9ff2993 commit 0b532e1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/plg_system_t3/includes/admin/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ public static function thememagic($path)
$listthemes = JFolder::folders($themepath);
if (count($listthemes)) {
foreach ($listthemes as $theme) {
$varsfile = $themepath . '/' . $theme . '/variables-custom.less';
if(file_exists($varsfile)){
//$varsfile = $themepath . '/' . $theme . '/variables-custom.less';
//if(file_exists($varsfile)){

$tobj = new stdClass();
$tobj->id = $theme;
Expand All @@ -295,7 +295,10 @@ public static function thememagic($path)
}

$cparams = new JRegistry;
$cparams->loadString(JFile::read($varsfile), 'LESS');
$varsfile = $themepath . '/' . $theme . '/variables.less';
if(file_exists($varsfile)) $cparams->loadString(JFile::read($varsfile), 'LESS');
$varsfile = $themepath . '/' . $theme . '/variables-custom.less';
if(file_exists($varsfile)) $cparams->loadString(JFile::read($varsfile), 'LESS');
if($params){
foreach ($cparams->toArray() as $key => $value) {
$params->set($key, $value);
Expand All @@ -306,7 +309,7 @@ public static function thememagic($path)

$themes[$theme] = $tobj;
$jsondata[$theme] = $params->toArray();
}
//}
}
}
}
Expand Down

0 comments on commit 0b532e1

Please sign in to comment.