Top.php 805 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace dokuwiki\Menu\Item;
  3. /**
  4. * Class Top
  5. *
  6. * Scroll back to the top. Uses a hash as $id which is handled special in getLink().
  7. * Not shown in mobile context
  8. */
  9. class Top extends AbstractItem {
  10. /** @inheritdoc */
  11. public function __construct() {
  12. parent::__construct();
  13. $this->svg = DOKU_INC . 'lib/images/menu/10-top_arrow-up.svg';
  14. $this->accesskey = 't';
  15. $this->params = array('do' => '');
  16. $this->id = '#dokuwiki__top';
  17. $this->context = self::CTX_DESKTOP;
  18. }
  19. /**
  20. * Convenience method to create a <button> element
  21. *
  22. * Uses html_topbtn()
  23. *
  24. * @todo this does currently not support the SVG icon
  25. * @return string
  26. */
  27. public function asHtmlButton() {
  28. return html_topbtn();
  29. }
  30. }