Use minimal mode to change site theme settings
- Use textarea in colorbox instead of inline HTML - Add mode propagation to site theme setting form - Set theme for site theme settings form to load JS dependencies
This commit is contained in:
parent
62f5438bb3
commit
838c0f96de
3 changed files with 10 additions and 20 deletions
|
@ -89,12 +89,10 @@ function admin_post(App $a)
|
||||||
|
|
||||||
$theme = $a->argv[2];
|
$theme = $a->argv[2];
|
||||||
if (is_file("view/theme/$theme/config.php")) {
|
if (is_file("view/theme/$theme/config.php")) {
|
||||||
$orig_theme = Renderer::$theme;
|
$a->setCurrentTheme($theme);
|
||||||
$orig_page = $a->page;
|
|
||||||
$orig_session_theme = $_SESSION['theme'];
|
|
||||||
require_once "view/theme/$theme/theme.php";
|
require_once "view/theme/$theme/theme.php";
|
||||||
require_once "view/theme/$theme/config.php";
|
require_once "view/theme/$theme/config.php";
|
||||||
$_SESSION['theme'] = $theme;
|
|
||||||
|
|
||||||
$init = $theme . '_init';
|
$init = $theme . '_init';
|
||||||
if (function_exists($init)) {
|
if (function_exists($init)) {
|
||||||
|
@ -103,17 +101,13 @@ function admin_post(App $a)
|
||||||
if (function_exists('theme_admin_post')) {
|
if (function_exists('theme_admin_post')) {
|
||||||
theme_admin_post($a);
|
theme_admin_post($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['theme'] = $orig_session_theme;
|
|
||||||
Renderer::$theme = $orig_theme;
|
|
||||||
$a->page = $orig_page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
info(L10n::t('Theme settings updated.'));
|
info(L10n::t('Theme settings updated.'));
|
||||||
if ($a->isAjax()) {
|
if ($a->isAjax()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$return_path = 'admin/themes/' . $theme;
|
$return_path = 'admin/themes/' . $theme . (!empty($_GET['mode']) ? '?mode=' . $_GET['mode'] : '');
|
||||||
break;
|
break;
|
||||||
case 'tos':
|
case 'tos':
|
||||||
admin_page_tos_post($a);
|
admin_page_tos_post($a);
|
||||||
|
@ -2312,12 +2306,10 @@ function admin_page_themes(App $a)
|
||||||
|
|
||||||
$admin_form = '';
|
$admin_form = '';
|
||||||
if (is_file("view/theme/$theme/config.php")) {
|
if (is_file("view/theme/$theme/config.php")) {
|
||||||
$orig_theme = Renderer::$theme;
|
$a->setCurrentTheme($theme);
|
||||||
$orig_page = $a->page;
|
|
||||||
$orig_session_theme = $_SESSION['theme'];
|
|
||||||
require_once "view/theme/$theme/theme.php";
|
require_once "view/theme/$theme/theme.php";
|
||||||
require_once "view/theme/$theme/config.php";
|
require_once "view/theme/$theme/config.php";
|
||||||
$_SESSION['theme'] = $theme;
|
|
||||||
|
|
||||||
$init = $theme . "_init";
|
$init = $theme . "_init";
|
||||||
if (function_exists($init)) {
|
if (function_exists($init)) {
|
||||||
|
@ -2327,10 +2319,6 @@ function admin_page_themes(App $a)
|
||||||
if (function_exists('theme_admin')) {
|
if (function_exists('theme_admin')) {
|
||||||
$admin_form = theme_admin($a);
|
$admin_form = theme_admin($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['theme'] = $orig_session_theme;
|
|
||||||
Renderer::$theme = $orig_theme;
|
|
||||||
$a->page = $orig_page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$screenshot = [Theme::getScreenshot($theme), L10n::t('Screenshot')];
|
$screenshot = [Theme::getScreenshot($theme), L10n::t('Screenshot')];
|
||||||
|
@ -2345,7 +2333,7 @@ function admin_page_themes(App $a)
|
||||||
'$toggle' => L10n::t('Toggle'),
|
'$toggle' => L10n::t('Toggle'),
|
||||||
'$settings' => L10n::t('Settings'),
|
'$settings' => L10n::t('Settings'),
|
||||||
'$baseurl' => System::baseUrl(true),
|
'$baseurl' => System::baseUrl(true),
|
||||||
'$addon' => $theme,
|
'$addon' => $theme . (!empty($_GET['mode']) ? '?mode=' . $_GET['mode'] : ''),
|
||||||
'$status' => $status,
|
'$status' => $status,
|
||||||
'$action' => $action,
|
'$action' => $action,
|
||||||
'$info' => Theme::getInfo($theme),
|
'$info' => Theme::getInfo($theme),
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
var theme = $("#id_theme :selected").val();
|
var theme = $("#id_theme :selected").val();
|
||||||
$("#cnftheme").attr('href',"{{$baseurl}}/admin/themes/"+theme);
|
$("#cnftheme").attr('href',"{{$baseurl}}/admin/themes/"+theme);
|
||||||
},*/
|
},*/
|
||||||
href: "{{$baseurl}}/admin/themes/" + $("#id_theme :selected").val(),
|
iframe: true,
|
||||||
|
href: "{{$baseurl}}/admin/themes/" + $("#id_theme :selected").val() + "?mode=minimal",
|
||||||
onComplete: function(){
|
onComplete: function(){
|
||||||
$("div#fancybox-content form").submit(function(e){
|
$("div#fancybox-content form").submit(function(e){
|
||||||
var url = $(this).attr('action');
|
var url = $(this).attr('action');
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
var theme = $("#id_theme :selected").val();
|
var theme = $("#id_theme :selected").val();
|
||||||
$("#cnftheme").attr('href',"{{$baseurl}}/admin/themes/"+theme);
|
$("#cnftheme").attr('href',"{{$baseurl}}/admin/themes/"+theme);
|
||||||
},*/
|
},*/
|
||||||
href: "{{$baseurl}}/admin/themes/" + $("#id_theme :selected").val(),
|
iframe: true,
|
||||||
|
href: "{{$baseurl}}/admin/themes/" + $("#id_theme :selected").val() + "?mode=minimal",
|
||||||
onComplete: function(){
|
onComplete: function(){
|
||||||
$("div#fancybox-content form").submit(function(e){
|
$("div#fancybox-content form").submit(function(e){
|
||||||
var url = $(this).attr('action');
|
var url = $(this).attr('action');
|
||||||
|
|
Loading…
Reference in a new issue