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

'styleCount' info added to all theme tablestyle() calls. 'styleCount' keeps count of the number of times the current style has been rendered. Usage example added to the bootstrap3 theme. Core news view template updated to use tablestyle caption correctly.

This commit is contained in:
Cameron
2021-02-19 07:33:05 -08:00
parent a136e3771c
commit c03e0ab066
3 changed files with 18 additions and 7 deletions

View File

@@ -21,6 +21,7 @@
private $content = array();
private $contentTypes = array('header', 'footer', 'text', 'title', 'image', 'list');
private $mainRenders = array(); // all renderered with style = 'default' or 'main'.
private $styleCount = array();
private $thm;
@@ -34,7 +35,7 @@
$this->load();
}
// Called in header.
// Called in header_default.php.
public function init()
{
@@ -331,7 +332,7 @@
private function hasLegacyCode()
{
$legacy = ['VIEWPORT', 'THEME_DISCLAIMER', 'IMODE', 'BODYTAG', 'COMMENTLINK', 'OTHERNEWS_LIMIT',
$legacy = ['VIEWPORT', 'THEME_DISCLAIMER', 'IMODE', 'HTMLTAG', 'BODYTAG', 'COMMENTLINK', 'OTHERNEWS_LIMIT',
'PRE_EXTENDEDSTRING', 'COMMENTOFFSTRING', 'CORE_CSS', 'TRACKBACKSTRING', 'TRACKBACKBEFORESTRING'];
foreach($legacy as $const)
@@ -376,6 +377,14 @@
$this->mainRenders[] = $options;
}
if(!empty($this->eSetStyle))
{
$this->styleCount[$this->eSetStyle]++;
}
$options['styleCount'] = varset($this->styleCount[$this->eSetStyle]);
//XXX Optional feature may be added if needed - define magic shortcodes inside $thm class. eg. function msc_custom();
if(!empty($this->thm) && is_object($this->thm))