name = 'Table of Contents'; $this->description = 'Sticky ToC sidebar (desktop) and floating drawer (mobile) from article headings.'; $this->dbFields = array( 'title' => 'On this page', 'navbarHeight' => 80, 'maxLevel' => 4, ); } public function form() { global $L; $title = htmlspecialchars($this->getValue('title'), ENT_QUOTES, 'UTF-8'); $navbarHeight = (int) $this->getValue('navbarHeight'); $maxLevel = (int) $this->getValue('maxLevel'); $h = ''; $h .= '
'; $h .= ''; $h .= ''; $h .= '
'; $h .= '
'; $h .= ''; $h .= ''; $h .= '' . $L->get('Deepest heading level included in the table of contents.') . ''; $h .= '
'; $h .= '
'; $h .= ''; $h .= ''; $h .= '' . $L->get('Pixel offset so heading anchors clear a fixed navbar.') . ''; $h .= '
'; return $h; } public function siteHead() { return '' . PHP_EOL; } public function siteBodyBegin() { $title = htmlspecialchars($this->getValue('title'), ENT_QUOTES, 'UTF-8'); return '' . PHP_EOL; } public function siteBodyEnd() { $title = json_encode($this->getValue('title')); $navbarHeight = (int) $this->getValue('navbarHeight'); $maxLevel = (int) $this->getValue('maxLevel'); return '' . PHP_EOL; } }