[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Menu/Item/ -> Top.php (source)

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