2020-04-02 23:15:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace dokuwiki\plugin\childrenpages;
|
|
|
|
|
|
|
|
use dokuwiki\Menu\Item\AbstractItem;
|
|
|
|
|
|
|
|
class MenuItem extends AbstractItem {
|
|
|
|
/**
|
|
|
|
* Generate a menu item from a passed string
|
|
|
|
*
|
|
|
|
* @param string $type
|
2020-04-02 23:44:50 +00:00
|
|
|
* @param string $label
|
2020-04-02 23:15:41 +00:00
|
|
|
*/
|
2020-04-02 23:44:50 +00:00
|
|
|
public function __construct(string $type, string $label) {
|
2020-04-02 23:52:49 +00:00
|
|
|
global $INFO;
|
2020-04-02 23:15:41 +00:00
|
|
|
$this->type = $type;
|
2020-04-02 23:44:50 +00:00
|
|
|
$this->label = $label;
|
2020-04-02 23:15:41 +00:00
|
|
|
parent::__construct();
|
2020-04-02 23:52:49 +00:00
|
|
|
// Edit the item to show a link to the requested children page
|
|
|
|
$this->id = $this->type.':'.$INFO['id'];
|
|
|
|
$this->params = [];
|
2020-04-02 23:15:41 +00:00
|
|
|
}
|
|
|
|
}
|