';
if (!$book->customtitles) {
- echo '
'.$titles[$ch->id].'
';
+ if (!$chapter->subchapter) {
+ echo '
'.$titles[$ch->id].'
';
+ } else {
+ echo '
'.$titles[$ch->id].'
';
+ }
}
$content = str_replace($link1, '#ch', $chapter->content);
$content = str_replace($link2, '#top', $content);
diff --git a/mod/book/tool/print/locallib.php b/mod/book/tool/print/locallib.php
index 200bee74867..27838a9ff2e 100644
--- a/mod/book/tool/print/locallib.php
+++ b/mod/book/tool/print/locallib.php
@@ -60,11 +60,7 @@ function booktool_print_get_toc($chapters, $book, $cm) {
$toc .= html_writer::tag('a', '', array('name' => 'toc')); // Representation of toc (HTML).
- if ($book->customtitles) {
- $toc .= html_writer::tag('h1', get_string('toc', 'mod_book'));
- } else {
- $toc .= html_writer::tag('p', get_string('toc', 'mod_book'), array('class' => 'book_chapter_title'));
- }
+ $toc .= html_writer::tag('h2', get_string('toc', 'mod_book'), array('class' => 'book_chapter_title'));
$toc .= html_writer::start_tag('ul');
foreach ($chapters as $ch) {
if (!$ch->hidden) {
diff --git a/mod/book/view.php b/mod/book/view.php
index f5643d36a5b..91b83b88f72 100644
--- a/mod/book/view.php
+++ b/mod/book/view.php
@@ -181,11 +181,12 @@ if (!$book->customtitles) {
$hidden = $chapter->hidden ? 'dimmed_text' : '';
if (!$chapter->subchapter) {
$currtitle = book_get_chapter_title($chapter->id, $chapters, $book, $context);
- echo '
'.$currtitle.'
';
+ echo $OUTPUT->heading($currtitle, 2, array('class' => 'book_chapter_title '.$hidden));
} else {
$currtitle = book_get_chapter_title($chapters[$chapter->id]->parent, $chapters, $book, $context);
$currsubtitle = book_get_chapter_title($chapter->id, $chapters, $book, $context);
- echo '
'.$currtitle.'
'.$currsubtitle.'
';
+ echo $OUTPUT->heading($currtitle, 2, array('class' => 'book_chapter_title '.$hidden));
+ echo $OUTPUT->heading($currsubtitle, 3, array('class' => 'book_chapter_title '.$hidden));
}
}
$chaptertext = file_rewrite_pluginfile_urls($chapter->content, 'pluginfile.php', $context->id, 'mod_book', 'chapter', $chapter->id);