You are here

function Pagination::parseSection in Pagination (Node) 6

Same name and namespace in other branches
  1. 7 includes/Pagination.inc \Pagination::parseSection()

@desc Handle splitting of sections in odd edge cases

Parameters

string text to parse: @param array matches @param int start tag position @param int end tag position @private

1 call to Pagination::parseSection()
Pagination::parseText in ./pagination.module
@desc Handle pagination depending on pagination style

File

./pagination.module, line 792
pagination.module @desc Allow for arbitrary nodes to be paginated. administrators can set which nodes they wish to paginate, and the length of content required to split a node into pages. Alternatively, content creators can set manual break points…

Class

Pagination
@desc Handles all the pagination logic

Code

function parseSection(&$text, $matches, $start, $end) {
  $open = isset($matches[$start]) && !isset($matches[$end]) ? $matches[$start] : '';
  $close = isset($matches[$end]) && $matches[$end] && isset($matches[$start]) && !$matches[$start] ? $matches[$end] : '';
  $split = strpos($text, $matches[0]);
  $section = substr($text, 0, $split) . $close;
  $text = $open . substr($text, $split + strlen($matches[0]));
  return $section;
}