La version française est disponible ici : pxArtListPagesFull
In order to add this function, you need to create:
- in manager/tools a folder named
myfunctions
- in manager/tools/myfunctions a file named
register.php
NB : the
register.php file must start with a:
<?php
and end with a:
?>
Add the following code inside
register.php:
/*
affiche tous les chapitres de l'article sur la même page
si le chapitre a le même titre que l'article, le titre du chapitre n'est pas affiché
display all pages of the article
if a page has the same title of the article, page's title is not displayed
*/
function pxArtListPagesFull
($s =
'%s',
$return=
false)
{
$art_title = pxArtTitle
('%s',
true);
$result =
'';
if ($GLOBALS['_PX_render']['art']->
pages->
nbRow() >=
1) {
$index =
$GLOBALS['_PX_render']['art']->
pages->
getIndex();
$GLOBALS['_PX_render']['art']->
pages->
moveStart();
$lp =
"";
while (!
$GLOBALS['_PX_render']['art']->
pages->
EOF()) {
$chap_title =
$GLOBALS['_PX_render']['art']->
pages->
f('page_title');
if (!
($GLOBALS['_PX_render']['art']->
pages->
int_index ==
0
&&
$art_title ==
$chap_title))
$lp .=
'<h3>'.
$chap_title.
'</h3>'.
"\n";
$lp.=
text::
parseContent($GLOBALS['_PX_render']['art']->
pages->
f('page_content')) .
"\n";
$GLOBALS['_PX_render']['art']->
pages->
moveNext();
}
$GLOBALS['_PX_render']['art']->
pages->
move($index);
$result =
sprintf($s,
$lp);
}
if ($return) return $result;
echo $result;
}
The function can then be used in the template
resource_article.php by:
<?php pxArtListPagesFull(); ?>