diff --git a/inc/functions.php b/inc/functions.php index 275c27d5..be3747d4 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -155,7 +155,7 @@ global $config, $_theme; $_theme = $theme; - $theme = loadThemeConfig($_theme, $action); + $theme = loadThemeConfig($_theme); if(file_exists($config['dir']['themes'] . '/' . $_theme . '/theme.php')) { require_once $config['dir']['themes'] . '/' . $_theme . '/theme.php'; @@ -169,7 +169,7 @@ // List themes $query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error()); while($theme = $query->fetch()) { - rebuildTheme($theme['theme']); + rebuildTheme($theme['theme'], $action); } } diff --git a/mod.php b/mod.php index a2ebff26..4159ed84 100644 --- a/mod.php +++ b/mod.php @@ -360,13 +360,21 @@ $query->bindValue(':theme', $_theme); $query->execute() or error(db_error($query)); + $body = ''; + if(isset($theme['install_callback'])) { + $ret = $theme['install_callback']($theme['config']); + if($ret && !empty($ret)) + $body .= '
' . $ret . '
'; + } + $body .= '

Successfully installed and built theme.

'; + // Build themes rebuildThemes('all'); echo Element('page.html', Array( 'config'=>$config, 'title'=>'Installed "' . htmlentities($theme['name']) . '"', - 'body'=>'

Successfully installed and built theme.

', + 'body'=>$body, 'mod'=>true ) ); @@ -382,7 +390,10 @@ switch($c['type']) { case 'text': default: - $body .= ''; + $body .= ''; } if(isset($c['comment'])) $body .= ' ' . $c['comment'] . '';