Merge branch 'MDL-33121' of git://github.com/rwijaya/moodle
[moodle.git] / mod / book / locallib.php
index a4c0487..26d0e40 100644 (file)
@@ -254,7 +254,11 @@ function book_get_toc($chapters, $chapter, $book, $cm, $edit) {
                     }
                 } else {
                     if ($book->numbering == BOOK_NUM_NUMBERS) {
-                        $title = "x.x $title";
+                        if (empty($chapters[$ch->parent]->hidden)) {
+                            $title = "$nch.x $title";
+                        } else {
+                            $title = "x.x $title";
+                        }
                     }
                     $title = html_writer::tag('span', $title, array('class' => 'dimmed_text'));
                 }