';
foreach($cells as $cell) {
if ($c == 0) $out[]='
';
$c++;
$out[]=" $cell | ";
if ($c == $ncols) { $c=0; $out[] = '
'; }
}
if ($c>0 && $c < $ncols) {
while($c < $ncols) { $c++; $out[] = ' | '; }
$out[] = '';
}
$out[] = '';
return implode($out);
}
function ColumnsInclude($pagename, $ncols, $inclname) {
$page = IncludeText($pagename, $inclname);
$cells = explode("\n", $page);
return ColumnsFmt($ncols, $cells);
}
Markup('columns','>if',"/\\(:columns\\s+(\\S*?)\\s+(\\S*?):\\)/ei",
"PRR(ColumnsInclude(\$pagename, '$1', '$2'))");
?>