. defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); define('NUM_NONE', '0'); define('NUM_NUMBERS', '1'); define('NUM_BULLETS', '2'); define('NUM_INDENTED', '3'); /* Included from mod/book/view.php and print.php. * * uses: * $chapters - all book chapters * $chapter - may be false * $cm - course module * $book - book * $edit - force editing view * * fills: * $toc * $title (not for print) */ $currtitle = ''; // Active chapter title (plain text). $currsubtitle = ''; // Active subchapter if any. $prevtitle = ' '; $toc = ''; // Representation of toc (HTML). $nch = 0; // Chapter number. $ns = 0; // Subchapter number. $title = ''; $first = 1; if (!isset($print)) { $print = 0; } switch ($book->numbering) { case NUM_NONE: $toc .= '
'.get_string('toc', 'book').'
'; } $titles = array(); $toc .= '