mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Theme config can now use plugin $fields markup and save prefs to own table.
This commit is contained in:
@@ -961,11 +961,14 @@ class themeHandler
|
|||||||
|
|
||||||
$newConfile = e_THEME.$this->id."/theme_config.php";
|
$newConfile = e_THEME.$this->id."/theme_config.php";
|
||||||
|
|
||||||
$legacyConfile = e_THEME.$this->id."/".$this->id."_config.php"; // @Deprecated
|
$legacyConfile = e_THEME.$this->id."/".$this->id."_config.php"; // @Deprecated
|
||||||
|
|
||||||
|
$newConfig = false;
|
||||||
|
|
||||||
if(is_readable($newConfile))
|
if(is_readable($newConfile))
|
||||||
{
|
{
|
||||||
$confile = $newConfile;
|
$confile = $newConfile;
|
||||||
|
$newConfig = true;
|
||||||
}
|
}
|
||||||
elseif(is_readable($legacyConfile))// TODO Eventually remove it.
|
elseif(is_readable($legacyConfile))// TODO Eventually remove it.
|
||||||
{
|
{
|
||||||
@@ -982,7 +985,7 @@ class themeHandler
|
|||||||
{
|
{
|
||||||
$mes->addDebug("Loading : ".$confile);
|
$mes->addDebug("Loading : ".$confile);
|
||||||
include ($confile);
|
include ($confile);
|
||||||
$className = 'theme_'.$this->id;
|
$className = ($newConfig === true) ? 'theme_config' : 'theme_'.$this->id;
|
||||||
if(class_exists($className))
|
if(class_exists($className))
|
||||||
{
|
{
|
||||||
$this->themeConfigObj = new $className();
|
$this->themeConfigObj = new $className();
|
||||||
@@ -1000,19 +1003,35 @@ class themeHandler
|
|||||||
{
|
{
|
||||||
|
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
$mes->addDebug(TPVLAN_87);
|
$frm = e107::getForm();
|
||||||
|
$mes->addDebug("Rendering Theme Config");
|
||||||
|
|
||||||
$this->loadThemeConfig();
|
$this->loadThemeConfig();
|
||||||
|
|
||||||
|
$value = e107::getThemeConfig('landingzero')->getPref();
|
||||||
|
|
||||||
if($this->themeConfigObj)
|
if($this->themeConfigObj)
|
||||||
{
|
{
|
||||||
$var = call_user_func(array(&$this->themeConfigObj, 'config'));
|
$var = call_user_func(array(&$this->themeConfigObj, 'config'));
|
||||||
vartrue($text); // avoid notice
|
$text = ''; // avoid notice
|
||||||
|
|
||||||
foreach ($var as $val)
|
foreach ($var as $field=>$val)
|
||||||
{
|
{
|
||||||
$text .= "<tr><td><b>".$val['caption']."</b>:</td><td colspan='2'>".$val['html']."<div class='field-help'>".$val['help']."</div>
|
if(is_numeric($field))
|
||||||
|
{
|
||||||
|
$text .= "<tr><td><b>".$val['caption']."</b>:</td><td colspan='2'>".$val['html']."<div class='field-help'>".$val['help']."</div>
|
||||||
</td></tr>";
|
</td></tr>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!empty($v['multilan']) && isset($value[$field][e_LANGUAGE]))
|
||||||
|
{
|
||||||
|
$value[$field] = varset($value[$field][e_LANGUAGE],'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "<tr><td><b>".$val['title']."</b>:</td><td colspan='2'>".$frm->renderElement($field, $value[$field], $val)."<div class='field-help'>".$val['help']."</div>
|
||||||
|
</td></tr>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
@@ -1020,6 +1039,8 @@ class themeHandler
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function renderThemeHelp()
|
function renderThemeHelp()
|
||||||
{
|
{
|
||||||
|
@@ -119,7 +119,7 @@ define("TPVLAN_83","Automated download not possible!");
|
|||||||
define("TPVLAN_84","[Please Download Manually]");
|
define("TPVLAN_84","[Please Download Manually]");
|
||||||
define("TPVLAN_85","Connecting...");
|
define("TPVLAN_85","Connecting...");
|
||||||
define("TPVLAN_86","Could not change site theme.");
|
define("TPVLAN_86","Could not change site theme.");
|
||||||
define("TPVLAN_87","Rendering Theme Config");
|
// define("TPVLAN_87","Rendering Theme Config"); //XXX Debug info
|
||||||
define("TPVLAN_88","Converter");
|
define("TPVLAN_88","Converter");
|
||||||
define("TPVLAN_89", "Apply dashboard preferences to all administrators");
|
define("TPVLAN_89", "Apply dashboard preferences to all administrators");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user