$prevpage = ''; } $pgnavigation = ''; if ($prevpage != '') { $pgnavigation .= '<a href="' . $prevpage . '.html"><img src="' . $img_page_prev . '"/></a> '; } if ($totalpages > 1) { $pgnavigation .= get_string('page', 'hiperbook') . " <b>" . $pagenum . '</b> ' . get_string('from', 'hiperbook') . ' <b>' . $totalpages . " </b> "; } if ($nextpage != '') { $pgnavigation .= '<a href="' . $nextpage . '.html"><img src="' . $img_page_next . '"/></a>'; } } // var_dump($pgnavigation); if ($navchapter->id != 0) { $breadcrumbs .= '<td id="current"><div id="start"> </div><div id="main"><a href="../navpaths/indexnavpath' . $navigationnum . '.html">' . $navpath->name . '</a></div><div id="end"> </div></td>' . hiperbook_link_parent_chapters_html($navchapter->id, $cm, $groupid); } // ===================================================== // Book display HTML code // ===================================================== ?> <div id="bookname"><?php echo $book->name; ?> </div><? // trata dos caminhos de navegacao // caso nao houver um, cria o 'caminho padrao' $navpaths = get_records_select('hiperbook_navigationpath',"bookid = $book->id", 'navpathnum'); if(!$navpaths){ $navpath->name = 'padrao'; $navpath->bookid= $book->id;
function hiperbook_link_parent_chapters_html($navigation_chapter_id, $cm, $groupid = 0) { // busca a navegacao atual $navigation_chapter = get_record('hiperbook_navigation_chapters', 'id', $navigation_chapter_id); $chapter = get_record('hiperbook_chapters', 'id', $navigation_chapter->chapterid); $navpath = get_record('hiperbook_navigationpath', 'id', $navigation_chapter->navigationid); //se tem pai if ($navigation_chapter->parentnavchapterid != 0) { $parentnavchapter = get_record('hiperbook_navigation_chapters', 'id', $navigation_chapter->parentnavchapterid); $parentchapters_links .= hiperbook_link_parent_chapters_html($parentnavchapter->id, $cm, $groupid); } $parentchapters_links .= '<td id="past"><div id="start"> > </div><div id="main"><a title="' . htmlspecialchars($parentchapter->title) . '" href="../../scos/cap' . $chapter->id . '/1.html">' . $chapter->title . '</a> </div><div id="end"> </div></td>'; return $parentchapters_links; }