<?php
// $Id: mospaging.php,v 1.3 2003/12/07 22:52:11 eddieajau Exp $
/**
* Page Break Mambot
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.3 $
* @author Andrew Eddie <eddieajau@user.sourceforge.net>
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

// $row and $mask are made available by the calling function

/**
* Page break mambot
*
* <b>Usage:</b>
* <code>{mospagebreak}</code>
* <code>{mospagebreak title=The page title}</code>
* <code>{mospagebreak title=The page title&toc=1}</code>
*
* If <i>title</i> is specified, then a page sub-title is included
*
* If <i>toc</i> is specified, then a table of contents is included
*/

require_once( "$mosConfig_absolute_path/mambots/mospaging.inc" );

if (!($mask&MASK_READON)) {
	if ($mask&MASK_POPUP) {
		$row->text = preg_replace( "/{mospagebreak\s*.*?}/i", '', $row->text );
	} else {
		MAMBOT_paging( $row, $mask, $pop );
	}
} else {
	// must be just showing the introtext
	$row->text = preg_replace( "/{mospagebreak\s*.*?}/i", '', $row->text );
}
?>