diff --git a/plugins/content/pagebreak/pagebreak.php b/plugins/content/pagebreak/pagebreak.php index 4ba66411dcaa1..9fe03f0b8ad14 100644 --- a/plugins/content/pagebreak/pagebreak.php +++ b/plugins/content/pagebreak/pagebreak.php @@ -252,15 +252,14 @@ public function onContentPrepare($context, &$row, &$params, $page = 0) */ protected function _createToc(&$row, &$matches, &$page) { - $heading = isset($row->title) ? $row->title : JText::_('PLG_CONTENT_PAGEBREAK_NO_TITLE'); - $input = JFactory::getApplication()->input; - $limitstart = $input->getUInt('limitstart', 0); - $showall = $input->getInt('showall', 0); - - // TOC header. - $row->toc = '
'; - - if ($this->params->get('article_index') == 1) + $heading = isset($row->title) ? $row->title : JText::_('PLG_CONTENT_PAGEBREAK_NO_TITLE'); + $input = JFactory::getApplication()->input; + $limitstart = $input->getUInt('limitstart', 0); + $showall = $input->getInt('showall', 0); + $headingtext = ''; + $list = array(); + + if ($this->params->get('article_index', 1) == 1) { $headingtext = JText::_('PLG_CONTENT_PAGEBREAK_ARTICLE_INDEX'); @@ -268,26 +267,19 @@ protected function _createToc(&$row, &$matches, &$page) { $headingtext = htmlspecialchars($this->params->get('article_index_text'), ENT_QUOTES, 'UTF-8'); } - - $row->toc .= '

' . $headingtext . '

'; } // TOC first Page link. - $class = ($limitstart === 0 && $showall === 0) ? 'toclink active' : 'toclink'; - $row->toc .= '
'; + $path = JPluginHelper::getLayoutPath('content', 'pagebreak', 'toc'); + ob_start(); + include $path; + $row->toc = ob_get_clean(); } /** diff --git a/plugins/content/pagebreak/tmpl/toc.php b/plugins/content/pagebreak/tmpl/toc.php new file mode 100644 index 0000000000000..9d68cb0ff8452 --- /dev/null +++ b/plugins/content/pagebreak/tmpl/toc.php @@ -0,0 +1,28 @@ + +
+ + +

+ + + +