function epub_ncx_item in Epub 7
Same name and namespace in other branches
- 8 epub.module \epub_ncx_item()
1 call to epub_ncx_item()
- epub_get_toc in ./
epub.module
File
- ./
epub.module, line 307
Code
function epub_ncx_item($navmap, $target = FALSE) {
$html = '<ol>';
foreach ($navmap as $item) {
if ($item
->attributes()->id) {
$html .= '<li><a href="' . $item->content
->attributes()->src . '"';
if ($target) {
$html .= ' target="' . $target . '" ';
}
$html .= '>' . $item->navLabel->text . '</a>';
//$html->addChild('li')->addChild('a', $item->navLabel->text)->addAttribute('href', $item->content->attributes()->src);
if ($item->navPoint) {
$subitems = epub_ncx_item($item->navPoint, $target);
$html .= $subitems;
}
$html .= '</li>';
}
}
$html .= '</ol>';
return $html;
}