diff --git a/mod/book/tool/print/index.php b/mod/book/tool/print/index.php
index 9077b84a9c3..f33f9a11ad7 100644
--- a/mod/book/tool/print/index.php
+++ b/mod/book/tool/print/index.php
@@ -91,6 +91,7 @@ if ($chapter) {
customtitles) {
if (!$chapter->subchapter) {
$currtitle = book_get_chapter_title($chapter->id, $chapters, $book, $context);
- echo '
'.$currtitle.'
';
+ echo '
'.$currtitle.'
';
} 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 '
'.$currtitle.'
'.$currsubtitle.'
';
}
}
@@ -128,7 +129,7 @@ if ($chapter) {
-
name, true, array('context'=>$context)) ?>
+
name, true, array('context'=>$context)) ?>
intro, $book->introformat, array('noclean'=>true, 'context'=>$context)) ?>
@@ -162,7 +163,11 @@ if ($chapter) {
}
echo '';
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) {