1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Issue #4350 theme.php class must now use init() and tablestyle() (not __construct() )

This commit is contained in:
Cameron
2021-01-17 07:27:28 -08:00
parent 06888f1fcf
commit f97dd307af
5 changed files with 25 additions and 8 deletions

View File

@@ -815,7 +815,7 @@ if (!class_exists('e107table', false))
private $thm;
public function init()
public function _init()
{
$this->legacyThemeClass = e107::getPref('sitetheme'). '_theme'; // disabled at the moment.
$this->adminThemeClass = e107::getPref('admintheme'). '_admintheme'; // Check for a class.
@@ -823,6 +823,19 @@ if (!class_exists('e107table', false))
$this->load();
}
// Called in header.
public function init()
{
if(empty($this->thm) || !method_exists($this->thm, 'init'))
{
return null;
}
ob_start(); // don't allow init() to echo.
$this->thm->init();
ob_end_clean();
}
/**
* Load theme class if necessary.
* @return null
@@ -853,7 +866,7 @@ if (!class_exists('e107table', false))
if(ADMIN && !$this->thm instanceof e_theme_render)
{
// debug - no need to translate.
echo "<div class='alert alert-danger'>class <b>".$this->themeClass."</b> is missing 'implements e_theme_render'</div>";
echo "<div class='alert alert-danger'>class <b>".$this->themeClass."</b> is missing 'implements e_theme_render'. Make sure there is an init() method also!</div>";
}
}
elseif(class_exists($this->legacyThemeClass)) // legacy v2.x
@@ -1406,7 +1419,7 @@ if(!isset($_E107['no_theme']))
}
}
$dbg->logTime("Init Theme Class");
e107::getRender()->init(); // initialize theme class.
e107::getRender()->_init(); // initialize theme class.
if ($pref['anon_post'])
{