From 549943fb1082bac14096d97ee2124052a8f6f364 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 1 Sep 2016 13:19:08 -0700 Subject: provide json module to load theme specific settings so we can auto-fill the display settings page with schemas and theme settings whenever somebody makes a different theme selection --- Zotlabs/Module/Theme.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Zotlabs/Module/Theme.php (limited to 'Zotlabs/Module/Theme.php') diff --git a/Zotlabs/Module/Theme.php b/Zotlabs/Module/Theme.php new file mode 100644 index 000000000..da23d9c15 --- /dev/null +++ b/Zotlabs/Module/Theme.php @@ -0,0 +1,44 @@ +get_theme_config_file($theme)) != null){ + require_once($themeconfigfile); + if(class_exists(ucfirst($theme) . 'Config')) { + $clsname = ucfirst($theme) . 'Config'; + $th_config = new $clsname(); + $schemas = $th_config->get_schemas(); + } + $theme_config = theme_content($a); + } + + $ret = array('theme' => $theme, 'schemas' => $schemas,'config' => $theme_config); + json_return_and_die($ret); + + } + + + function get_theme_config_file($theme){ + + $base_theme = \App::$theme_info['extends']; + + if (file_exists("view/theme/$theme/php/config.php")){ + return "view/theme/$theme/php/config.php"; + } + if (file_exists("view/theme/$base_theme/php/config.php")){ + return "view/theme/$base_theme/php/config.php"; + } + return null; + } + + +} \ No newline at end of file -- cgit v1.2.3