function epub_get_nav in Epub 7
Same name and namespace in other branches
- 8 epub.module \epub_get_nav()
1 call to epub_get_nav()
- epub_get_toc in ./
epub.module
File
- ./
epub.module, line 254
Code
function epub_get_nav($dir) {
$file = epub_get_opf($dir);
if ($file == FALSE) {
return false;
}
$opfXML = simplexml_load_file($file);
$opfXML
->registerXPathNamespace('opf', 'http://www.idpf.org/2007/opf');
$nav = $opfXML
->xpath('//opf:item[@properties="nav"]');
if ($nav) {
$attributes = $nav[0]
->attributes();
return dirname($file) . '/' . (string) $attributes['href'];
}
else {
return FALSE;
}
}