Merge pull request #2037 from fabrixxm/issue_2022
Not current theme settings in admin page
This commit is contained in:
commit
50b3232bb0
1 changed files with 46 additions and 7 deletions
|
@ -47,12 +47,35 @@ function admin_post(&$a){
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
break;
|
break;
|
||||||
case 'themes':
|
case 'themes':
|
||||||
|
if ($a->argc < 2) {
|
||||||
|
if(is_ajax()) return;
|
||||||
|
goaway($a->get_baseurl(true) . '/admin/' );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$theme = $a->argv[2];
|
$theme = $a->argv[2];
|
||||||
if (is_file("view/theme/$theme/config.php")){
|
if (is_file("view/theme/$theme/config.php")){
|
||||||
require_once("view/theme/$theme/config.php");
|
function __call_theme_admin_post(&$a, $theme) {
|
||||||
if (function_exists("theme_admin_post")){
|
$orig_theme = $a->theme;
|
||||||
theme_admin_post($a);
|
$orig_page = $a->page;
|
||||||
|
$orig_session_theme = $_SESSION['theme'];
|
||||||
|
require_once("view/theme/$theme/theme.php");
|
||||||
|
require_once("view/theme/$theme/config.php");
|
||||||
|
$_SESSION['theme'] = $theme;
|
||||||
|
|
||||||
|
|
||||||
|
$init = $theme."_init";
|
||||||
|
if(function_exists($init)) $init($a);
|
||||||
|
if(function_exists("theme_admin_post")){
|
||||||
|
$admin_form = theme_admin_post($a);
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['theme'] = $orig_session_theme;
|
||||||
|
$a->theme = $orig_theme;
|
||||||
|
$a->page = $orig_page;
|
||||||
|
return $admin_form;
|
||||||
}
|
}
|
||||||
|
__call_theme_admin_post($a, $theme);
|
||||||
}
|
}
|
||||||
info(t('Theme settings updated.'));
|
info(t('Theme settings updated.'));
|
||||||
if(is_ajax()) return;
|
if(is_ajax()) return;
|
||||||
|
@ -1405,11 +1428,27 @@ function admin_page_themes(&$a){
|
||||||
|
|
||||||
$admin_form="";
|
$admin_form="";
|
||||||
if (is_file("view/theme/$theme/config.php")){
|
if (is_file("view/theme/$theme/config.php")){
|
||||||
require_once("view/theme/$theme/config.php");
|
function __get_theme_admin_form(&$a, $theme) {
|
||||||
if(function_exists("theme_admin")){
|
$orig_theme = $a->theme;
|
||||||
$admin_form = theme_admin($a);
|
$orig_page = $a->page;
|
||||||
}
|
$orig_session_theme = $_SESSION['theme'];
|
||||||
|
require_once("view/theme/$theme/theme.php");
|
||||||
|
require_once("view/theme/$theme/config.php");
|
||||||
|
$_SESSION['theme'] = $theme;
|
||||||
|
|
||||||
|
|
||||||
|
$init = $theme."_init";
|
||||||
|
if(function_exists($init)) $init($a);
|
||||||
|
if(function_exists("theme_admin")){
|
||||||
|
$admin_form = theme_admin($a);
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['theme'] = $orig_session_theme;
|
||||||
|
$a->theme = $orig_theme;
|
||||||
|
$a->page = $orig_page;
|
||||||
|
return $admin_form;
|
||||||
|
}
|
||||||
|
$admin_form = __get_theme_admin_form($a, $theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
|
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
|
||||||
|
|
Loading…
Reference in a new issue