Source for file mospaging.php
Documentation is available at mospaging.php
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$this->registerFunction( 'onPrepareContent', 'botMosPaging' );
* <code>{mospagebreak}</code>
* <code>{mospagebreak title=The page title}</code>
* <code>{mospagebreak heading=The first page}</code>
* <code>{mospagebreak title=The page title&heading=The first page}</code>
* <code>{mospagebreak heading=The first page&title=The page title}</code>
function botMosPaging( $published, &$row, &$cparams, $page=
0, $params ) {
global $mainframe, $Itemid, $database;
// expression to search for
$regex =
'/{(mospagebreak)\s*(.*?)}/i';
if (!$published ||
$cparams->get( 'intro_only' )||
$cparams->get( 'popup' )) {
// find all instances of mambot and put in $matches
// split the text around the mambot
// count the number of pages
// we have found at least one mambot, therefore at least 2 pages
// load mambot params info
$title =
$cparams->def( 'title', 1 );
// adds heading or title to <site> Title
$row->page_title =
T_('Page') .
' '.
$page_text;
// processing for first page
if ( @$args['heading'] ) {
$row->page_title =
$args['heading'];
} else if ( $matches[$page-
1][2] ) {
$row->page_title =
$args['title'];
// reset the text, we already hold it in the $text array
$hasToc =
$mainframe->getCfg( 'multipage_toc' );
// traditional mos page navigation
require_once( $GLOBALS['mosConfig_absolute_path'] .
'/includes/pageNavigation.php' );
$row->text .=
'<div class="pagenavcounter">';
$row->text .=
$pageNav->writeLeafsCounter();
$row->text .=
$text[$page];
$row->text .=
'<div class="pagenavbar">';
// adds navigation between pages to bottom of text
// page links shown at bottom of page if TOC disabled
$row->text .=
$pageNav->writePagesLinks( 'index.php?option=com_content&task=view&id='.
$row->id .
'&Itemid='.
$Itemid );
$row->text .=
'</div><br />';
function createTOC( &$row, &$matches, &$page ) {
$nonseflink =
'index.php?option=com_content&task=view&id='.
$row->id .
'&Itemid='.
$Itemid;
$link =
'index.php?option=com_content&task=view&id='.
$row->id .
'&Itemid='.
$Itemid;
// allows customization of first page title by checking for `heading` attribute in first bot
if ( @$args['heading'] ) {
$heading =
$args['heading'];
<table cellpadding="0" cellspacing="0" class="contenttoc" align="right">
<a href="'.
$link .
'" class="toclink">'
foreach ( $matches as $bot ) {
$link =
$nonseflink .
'&limit=1&limitstart='.
($i-
1);
if ( @$args2['title'] ) {
<a href="'.
$link .
'" class="toclink">'
<a href="'.
$link .
'" class="toclink">'
<a href="'.
$link .
'" class="toclink">'
$link =
'index.php?option=com_content&task=view&id='.
$row->id .
'&Itemid='.
$Itemid;
$link_next =
$link .
'&limit=1&limitstart='.
( $page +
1 );
$next =
'<a href="'.
$link_next .
'">' .
T_('Next >>').
'</a>';
$link_prev =
$link .
'&limit=1&limitstart='.
( $page -
1 );
$prev =
'<a href="'.
$link_prev .
'">'.
T_('<<Previous') .
'</a>';
$row->text .=
'<div>' .
$prev .
' - ' .
$next .
'</div>';
Documentation generated on Mon, 05 May 2008 16:21:32 +0400 by phpDocumentor 1.4.0