Skip to content

Commit

Permalink
Update pagebreak.php
Browse files Browse the repository at this point in the history
  • Loading branch information
AndySDH committed Jan 5, 2018
1 parent 05fd1d9 commit 9b61d09
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions plugins/content/pagebreak/pagebreak.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function onContentPrepare($context, &$row, &$params, $page = 0)
{
throw new Exception(JText::_('JERROR_PAGE_NOT_FOUND'), 404);
}

return true;
}

Expand Down Expand Up @@ -180,9 +180,12 @@ public function onContentPrepare($context, &$row, &$params, $page = 0)
// Page text.
$text[$page] = str_replace('<hr id="system-readmore" />', '', $text[$page]);
$row->text .= $text[$page];

// $row->text .= '<br />';
$row->text .= '<div class="pager">';

// page counter
$row->text .= '<div class="pagenavbar">';
$row->text .= '<div class="pagenavcounter">';
$row->text .= $pageNav->getPagesCounter();
$row->text .= '</div>';

// Adds navigation between pages to bottom of text.
if ($hasToc)
Expand Down Expand Up @@ -355,27 +358,19 @@ protected function _createNavigation(&$row, $page, $n)
$link_next = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=&limitstart=' . $page_next);

// Next >>
$next = '<a href="' . $link_next . '">' . JText::_('JNEXT') . $pnSpace . JText::_('JGLOBAL_GT') . JText::_('JGLOBAL_GT') . '</a>';
}
else
{
$next = JText::_('JNEXT');
$next = '<a class="next_page" href="' . $link_next . '">' . JText::_( 'Next Page' ) . $pnSpace . JText::_('JGLOBAL_GT') . '</a>';
}

if ($page > 0)
{
$page_prev = $page - 1 === 0 ? '' : $page - 1;

$link_prev = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=&limitstart=' . $page_prev);

// << Prev
$prev = '<a href="' . $link_prev . '">' . JText::_('JGLOBAL_LT') . JText::_('JGLOBAL_LT') . $pnSpace . JText::_('JPREV') . '</a>';
}
else
{
$prev = JText::_('JPREV');
$prev = '<a class="prev_page" href="' . $link_prev . '">' . JText::_('JGLOBAL_LT') . $pnSpace . JText::_( 'Prev Page' ) . '</a>';
}

$row->text .= '<ul><li>' . $prev . ' </li><li>' . $next . '</li></ul>';
$row->text .= $prev . $next;
}
}

0 comments on commit 9b61d09

Please sign in to comment.