1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Allow theme config page to use custom methods. (see bootstrap3 for example)

This commit is contained in:
Cameron 2017-11-02 14:30:19 -07:00
parent a70add174e
commit 73301881dd
2 changed files with 25 additions and 7 deletions

View File

@ -814,6 +814,7 @@ class themeHandler
var $frm;
var $fl;
var $themeConfigObj = null;
var $themeConfigFormObj= null;
var $noLog = FALSE;
private $curTheme = null;
@ -1816,6 +1817,11 @@ class themeHandler
if(class_exists('theme_config')) // new v2.1.4 theme_config is the class name.
{
$this->themeConfigObj = new theme_config();
if(class_exists('theme_config_form')) // new v2.1.7
{
$this->themeConfigFormObj = new theme_config_form();
}
}
elseif(class_exists($className)) // old way.
{
@ -1834,7 +1840,9 @@ class themeHandler
{
$mes = e107::getMessage();
$frm = e107::getForm();
$frm = ($this->themeConfigFormObj !== null) ? $this->themeConfigFormObj : e107::getForm();
$pref = e107::getConfig()->getPref();
e107::getDebug()->log("Rendering Theme Config");
@ -1856,8 +1864,7 @@ class themeHandler
{
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>";
$text .= "<tr><td><b>".$val['caption']."</b>:</td><td colspan='2'>".$val['html']."<div class='field-help'>".$val['help']."</div></td></tr>";
}
else
{
@ -1867,8 +1874,7 @@ class themeHandler
}
$tdClass = !empty($val['writeParms']['post']) ? 'form-inline' : '';
$text .= "<tr><td><b>".$val['title']."</b>:</td><td class='".$tdClass."' colspan='2'>".$frm->renderElement($field, $value[$field], $val)."<div class='field-help'>".$val['help']."</div>
</td></tr>";
$text .= "<tr><td><b>".$val['title']."</b>:</td><td class='".$tdClass."' colspan='2'>".$frm->renderElement($field, $value[$field], $val)."<div class='field-help'>".$val['help']."</div></td></tr>";
}
}

View File

@ -53,5 +53,17 @@ class theme_config implements e_theme_config
}
}
/*
// Custom Methods
class theme_config_form extends e_form
{
?>
function custom_method($value,$mode,$parms) // named the same as $fields key.(eg. 'branding') Used when type = 'method'
{
return $this->text('custom_method', $value);
}
}
*/