Usage:
*
*
* or
*
* or
*
* or
*
*
* @package Joomla.Plugin
* @subpackage Content.pagebreak
* @since 1.6
*/
class PlgContentPagebreak extends JPlugin
{
/**
* Load the language file on instantiation.
*
* @var boolean
* @since 3.1
*/
protected $autoloadLanguage = true;
/**
* Plugin that adds a pagebreak into the text and truncates text at that point
*
* @param string $context The context of the content being passed to the plugin.
* @param object &$row The article object. Note $article->text is also available
* @param mixed &$params The article params
* @param integer $page The 'page' number
*
* @return mixed Always returns void or true
*
* @since 1.6
*/
public function onContentPrepare($context, &$row, &$params, $page = 0)
{
$canProceed = $context == 'com_content.article';
if (!$canProceed)
{
return;
}
$style = $this->params->get('style', 'pages');
// Expression to search for.
$regex = '#