put theme config into its own namespace

This commit is contained in:
redmatrix 2016-09-01 22:20:08 -07:00
parent b3efdf2109
commit 47dd1da6fb
3 changed files with 8 additions and 6 deletions

View File

@ -268,8 +268,8 @@ class Settings extends \Zotlabs\Web\Controller {
// call theme_post only if theme has not been changed // call theme_post only if theme has not been changed
if( ($themeconfigfile = $this->get_theme_config_file($theme)) != null){ if( ($themeconfigfile = $this->get_theme_config_file($theme)) != null){
require_once($themeconfigfile); require_once($themeconfigfile);
if(class_exists(ucfirst($theme) . 'Config')) { if(class_exists('\\Zotlabs\\Theme\\' . ucfirst($theme) . 'Config')) {
$clsname = ucfirst($theme) . 'Config'; $clsname = '\\Zotlabs\\Theme\\' . ucfirst($theme) . 'Config';
$theme_config = new $clsname(); $theme_config = new $clsname();
$schemas = $theme_config->get_schemas(); $schemas = $theme_config->get_schemas();
if(array_key_exists($_POST['schema'],$schemas)) if(array_key_exists($_POST['schema'],$schemas))

View File

@ -15,8 +15,8 @@ class Theme_info extends \Zotlabs\Web\Controller {
$theme_config = ""; $theme_config = "";
if(($themeconfigfile = $this->get_theme_config_file($theme)) != null){ if(($themeconfigfile = $this->get_theme_config_file($theme)) != null){
require_once($themeconfigfile); require_once($themeconfigfile);
if(class_exists(ucfirst($theme) . 'Config')) { if(class_exists('\\Zotlabs\\Theme\\' . ucfirst($theme) . 'Config')) {
$clsname = ucfirst($theme) . 'Config'; $clsname = '\\Zotlabs\\Theme\\' . ucfirst($theme) . 'Config';
$th_config = new $clsname(); $th_config = new $clsname();
$schemas = $th_config->get_schemas(); $schemas = $th_config->get_schemas();
if($schemas) { if($schemas) {

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Zotlabs\Theme;
class RedbasicConfig { class RedbasicConfig {
function get_schemas() { function get_schemas() {
@ -103,7 +105,7 @@ class RedbasicConfig {
$o .= replace_macros(get_markup_template('theme_settings.tpl'), array( $o .= replace_macros(get_markup_template('theme_settings.tpl'), array(
'$submit' => t('Submit'), '$submit' => t('Submit'),
'$baseurl' => z_root(), '$baseurl' => z_root(),
'$theme' => App::$channel['channel_theme'], '$theme' => \App::$channel['channel_theme'],
'$expert' => $expert, '$expert' => $expert,
'$title' => t("Theme settings"), '$title' => t("Theme settings"),
'$narrow_navbar' => array('redbasic_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar'], '', array(t('No'),t('Yes'))), '$narrow_navbar' => array('redbasic_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar'], '', array(t('No'),t('Yes'))),