dbFields = array( // Label shown at the top of the sidebar and in the mobile drawer. 'title' => 'On this page', // Pixel offset to clear the fixed navbar when jumping to a heading. 'navbarHeight' => 80, // Viewport width (px) at which the fixed sidebar appears. // Below this width the mobile floating-button drawer is used instead. 'minWidth' => 1280, ); } // ---- Admin settings form ---- public function form() { global $L; $title = htmlspecialchars($this->getValue('title'), ENT_QUOTES, 'UTF-8'); $navbarHeight = (int) $this->getValue('navbarHeight'); $minWidth = (int) $this->getValue('minWidth'); $h = ''; $h .= '
'; $h .= ''; $h .= ''; $h .= '
'; $h .= '
'; $h .= ''; $h .= ''; $h .= '' . $L->get('Used to offset hash-jump anchors so they clear the fixed navbar.') . ''; $h .= '
'; $h .= '
'; $h .= ''; $h .= ''; $h .= '' . $L->get('Viewport widths below this value use the mobile floating button instead.') . ''; $h .= '
'; return $h; } // ---- Front-end hooks ---- /** * Inject the plugin CSS in . */ public function siteHead() { $url = DOMAIN_PLUGINS . $this->directoryName . '/toc.css'; return '' . PHP_EOL; } /** * Inject the ToC sidebar container right after . * It is position:fixed, so placement in the DOM doesn't affect layout. * JS will populate