1<?php 2 3namespace dokuwiki\Menu\Item; 4 5/** 6 * Class Feed 7 */ 8class Feed extends AbstractItem 9{ 10 11 /** @inheritdoc */ 12 public function __construct() 13 { 14 parent::__construct(); 15 16 global $lang; 17 18 if (!in_array('feed', explode(',', tpl_getConf('pageIcons')))) { 19 throw new \RuntimeException("feed is not available"); 20 } 21 22 unset($this->params['do']); 23 24 $this->label = $lang['btn_recent']; 25 $this->svg = tpl_incdir() . 'images/menu/rss.svg'; 26 } 27 28 public function getLinkAttributes($classprefix = 'menuitem ') 29 { 30 $attr = parent::getLinkAttributes($classprefix); 31 $attr['href'] = DOKU_URL . 'feed.php?ns=' . getNS($this->id); 32 33 return $attr; 34 } 35} 36