Lines Matching full:this
8 * This class defines a single Item to be displayed in one of DokuWiki's menus. Plugins
9 * can extend those menus through action plugins and add their own instances of this class,
33 /** @var string the page id this action links to */
35 /** @var string the method to be used when this action is used in a form */
41 /** @var string this item's label may contain a placeholder, which is replaced with this */
43 /** @var string the full path to the SVG icon of this menu item */
49 /** @var int the context this item is shown in */
64 $this->id = $ID;
65 $this->type = $this->getType();
66 $this->params['do'] = $this->type;
68 if (!actionOK($this->type)) throw new \RuntimeException("action disabled: {$this->type}");
72 * Return this item's label
82 if ($this->label !== '') return $this->label;
86 $label = $lang['btn_' . $this->type];
88 $label = sprintf($label, $this->replacement);
90 if ($label === '') $label = '[' . $this->type . ']';
95 * Return this item's title
97 * This title should be used to display a tooltip (using the HTML title attribute). If
104 if ($this->title === '') return $this->getLabel();
105 return $this->title;
109 * Return the link this item links to
121 if ($this->id && $this->id[0] == '#') {
122 return $this->id;
124 return wl($this->id, $this->params, false, '&');
131 … * @param string|false $classprefix create a class from type with this prefix, false for no class
137 $attr = ['href' => $this->getLink(), 'title' => $this->getTitle()];
138 if ($this->isNofollow()) $attr['rel'] = 'nofollow';
139 if ($this->getAccesskey()) {
140 $attr['accesskey'] = $this->getAccesskey();
141 $attr['title'] .= ' [' . $this->getAccesskey() . ']';
143 if ($classprefix !== false) $attr['class'] = $classprefix . $this->getType();
153 … * @param string|false $classprefix create a class from type with this prefix, false for no class
159 $attr = buildAttributes($this->getLinkAttributes($classprefix));
162 $html .= '<span>' . hsc($this->getLabel()) . '</span>';
163 $html .= inlineSVG($this->getSvg());
165 $html .= hsc($this->getLabel());
182 $this->getType(),
183 $this->id,
184 $this->getAccesskey(),
185 $this->getParams(),
186 $this->method,
187 $this->getTitle(),
188 $this->getLabel(),
189 $this->getSvg()
194 * Should this item be shown in the given context
201 return (bool)($ctx & $this->context);
205 * @return string the name of this item
209 if ($this->type === '') {
210 $this->type = strtolower(substr(strrchr(get_class($this), '\\'), 1));
212 return $this->type;
220 return $this->accesskey;
228 return $this->params;
236 return $this->nofollow;
244 return $this->svg;
248 * Return this Item's settings as an array as used in tpl_get_action()
255 'accesskey' => $this->accesskey ?: null,
256 'type' => $this->type,
257 'id' => $this->id,
258 'method' => $this->method,
259 'params' => $this->params,
260 'nofollow' => $this->nofollow,
261 'replacement' => $this->replacement