1<?php 2/** 3 * DokuWiki Plugin actionrenderer (Renderer Component) 4 * 5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 6 * @author Andreas Gohr <andi@splitbrain.org> 7 */ 8 9 10class renderer_plugin_actionrenderer extends Doku_Renderer_xhtml 11{ 12 13 /** 14 * Make available as XHTML replacement renderer 15 * @param string $format requested format 16 * @return bool 17 */ 18 public function canRender($format) 19 { 20 if ($format == 'xhtml') { 21 return true; 22 } 23 return false; 24 } 25 26 /** 27 * Wrap the method in an event and call it on the parent 28 * 29 * @param string $method 30 * @param array $arguments 31 * @return mixed 32 */ 33 protected function trigger($method, $arguments) 34 { 35 $data = [ 36 'method' => $method, 37 'renderer' => $this, 38 'arguments' => &$arguments 39 ]; 40 41 $event = new Doku_Event('PLUGIN_ACTIONRENDERER_METHOD_EXECUTE', $data); 42 if ($event->advise_before()) { 43 $event->result = call_user_func_array([$this, 'parent::' . $method], $arguments); 44 } 45 $event->advise_after(); 46 return $event->result; 47 } 48 49 50 /** @inheritDoc */ 51 public function document_start() 52 { 53 return $this->trigger(__FUNCTION__, func_get_args()); 54 } 55 56 /** @inheritDoc */ 57 public function document_end() 58 { 59 return $this->trigger(__FUNCTION__, func_get_args()); 60 } 61 62 /** @inheritDoc */ 63 public function toc_additem($id, $text, $level) 64 { 65 return $this->trigger(__FUNCTION__, func_get_args()); 66 } 67 68 /** @inheritDoc */ 69 public function header($text, $level, $pos, $returnonly = false) 70 { 71 return $this->trigger(__FUNCTION__, func_get_args()); 72 } 73 74 /** @inheritDoc */ 75 public function section_open($level) 76 { 77 return $this->trigger(__FUNCTION__, func_get_args()); 78 } 79 80 /** @inheritDoc */ 81 public function section_close() 82 { 83 return $this->trigger(__FUNCTION__, func_get_args()); 84 } 85 86 /** @inheritDoc */ 87 public function cdata($text) 88 { 89 return $this->trigger(__FUNCTION__, func_get_args()); 90 } 91 92 /** @inheritDoc */ 93 public function p_open() 94 { 95 return $this->trigger(__FUNCTION__, func_get_args()); 96 } 97 98 /** @inheritDoc */ 99 public function p_close() 100 { 101 return $this->trigger(__FUNCTION__, func_get_args()); 102 } 103 104 /** @inheritDoc */ 105 public function linebreak() 106 { 107 return $this->trigger(__FUNCTION__, func_get_args()); 108 } 109 110 /** @inheritDoc */ 111 public function hr() 112 { 113 return $this->trigger(__FUNCTION__, func_get_args()); 114 } 115 116 /** @inheritDoc */ 117 public function strong_open() 118 { 119 return $this->trigger(__FUNCTION__, func_get_args()); 120 } 121 122 /** @inheritDoc */ 123 public function strong_close() 124 { 125 return $this->trigger(__FUNCTION__, func_get_args()); 126 } 127 128 /** @inheritDoc */ 129 public function emphasis_open() 130 { 131 return $this->trigger(__FUNCTION__, func_get_args()); 132 } 133 134 /** @inheritDoc */ 135 public function emphasis_close() 136 { 137 return $this->trigger(__FUNCTION__, func_get_args()); 138 } 139 140 /** @inheritDoc */ 141 public function underline_open() 142 { 143 return $this->trigger(__FUNCTION__, func_get_args()); 144 } 145 146 /** @inheritDoc */ 147 public function underline_close() 148 { 149 return $this->trigger(__FUNCTION__, func_get_args()); 150 } 151 152 /** @inheritDoc */ 153 public function monospace_open() 154 { 155 return $this->trigger(__FUNCTION__, func_get_args()); 156 } 157 158 /** @inheritDoc */ 159 public function monospace_close() 160 { 161 return $this->trigger(__FUNCTION__, func_get_args()); 162 } 163 164 /** @inheritDoc */ 165 public function subscript_open() 166 { 167 return $this->trigger(__FUNCTION__, func_get_args()); 168 } 169 170 /** @inheritDoc */ 171 public function subscript_close() 172 { 173 return $this->trigger(__FUNCTION__, func_get_args()); 174 } 175 176 /** @inheritDoc */ 177 public function superscript_open() 178 { 179 return $this->trigger(__FUNCTION__, func_get_args()); 180 } 181 182 /** @inheritDoc */ 183 public function superscript_close() 184 { 185 return $this->trigger(__FUNCTION__, func_get_args()); 186 } 187 188 /** @inheritDoc */ 189 public function deleted_open() 190 { 191 return $this->trigger(__FUNCTION__, func_get_args()); 192 } 193 194 /** @inheritDoc */ 195 public function deleted_close() 196 { 197 return $this->trigger(__FUNCTION__, func_get_args()); 198 } 199 200 /** @inheritDoc */ 201 public function footnote_open() 202 { 203 return $this->trigger(__FUNCTION__, func_get_args()); 204 } 205 206 /** @inheritDoc */ 207 public function footnote_close() 208 { 209 return $this->trigger(__FUNCTION__, func_get_args()); 210 } 211 212 /** @inheritDoc */ 213 public function listu_open($classes = null) 214 { 215 return $this->trigger(__FUNCTION__, func_get_args()); 216 } 217 218 /** @inheritDoc */ 219 public function listu_close() 220 { 221 return $this->trigger(__FUNCTION__, func_get_args()); 222 } 223 224 /** @inheritDoc */ 225 public function listo_open($classes = null) 226 { 227 return $this->trigger(__FUNCTION__, func_get_args()); 228 } 229 230 /** @inheritDoc */ 231 public function listo_close() 232 { 233 return $this->trigger(__FUNCTION__, func_get_args()); 234 } 235 236 /** @inheritDoc */ 237 public function listitem_open($level, $node = false) 238 { 239 return $this->trigger(__FUNCTION__, func_get_args()); 240 } 241 242 /** @inheritDoc */ 243 public function listitem_close() 244 { 245 return $this->trigger(__FUNCTION__, func_get_args()); 246 } 247 248 /** @inheritDoc */ 249 public function listcontent_open() 250 { 251 return $this->trigger(__FUNCTION__, func_get_args()); 252 } 253 254 /** @inheritDoc */ 255 public function listcontent_close() 256 { 257 return $this->trigger(__FUNCTION__, func_get_args()); 258 } 259 260 /** @inheritDoc */ 261 public function unformatted($text) 262 { 263 return $this->trigger(__FUNCTION__, func_get_args()); 264 } 265 266 /** @inheritDoc */ 267 public function php($text, $wrapper = 'code') 268 { 269 return $this->trigger(__FUNCTION__, func_get_args()); 270 } 271 272 /** @inheritDoc */ 273 public function phpblock($text) 274 { 275 return $this->trigger(__FUNCTION__, func_get_args()); 276 } 277 278 /** @inheritDoc */ 279 public function html($text, $wrapper = 'code') 280 { 281 return $this->trigger(__FUNCTION__, func_get_args()); 282 } 283 284 /** @inheritDoc */ 285 public function htmlblock($text) 286 { 287 return $this->trigger(__FUNCTION__, func_get_args()); 288 } 289 290 /** @inheritDoc */ 291 public function quote_open() 292 { 293 return $this->trigger(__FUNCTION__, func_get_args()); 294 } 295 296 /** @inheritDoc */ 297 public function quote_close() 298 { 299 return $this->trigger(__FUNCTION__, func_get_args()); 300 } 301 302 /** @inheritDoc */ 303 public function preformatted($text) 304 { 305 return $this->trigger(__FUNCTION__, func_get_args()); 306 } 307 308 /** @inheritDoc */ 309 public function file($text, $language = null, $filename = null, $options = null) 310 { 311 return $this->trigger(__FUNCTION__, func_get_args()); 312 } 313 314 /** @inheritDoc */ 315 public function code($text, $language = null, $filename = null, $options = null) 316 { 317 return $this->trigger(__FUNCTION__, func_get_args()); 318 } 319 320 /** @inheritDoc */ 321 public function acronym($acronym) 322 { 323 return $this->trigger(__FUNCTION__, func_get_args()); 324 } 325 326 /** @inheritDoc */ 327 public function smiley($smiley) 328 { 329 return $this->trigger(__FUNCTION__, func_get_args()); 330 } 331 332 /** @inheritDoc */ 333 public function entity($entity) 334 { 335 return $this->trigger(__FUNCTION__, func_get_args()); 336 } 337 338 /** @inheritDoc */ 339 public function multiplyentity($x, $y) 340 { 341 return $this->trigger(__FUNCTION__, func_get_args()); 342 } 343 344 /** @inheritDoc */ 345 public function singlequoteopening() 346 { 347 return $this->trigger(__FUNCTION__, func_get_args()); 348 } 349 350 /** @inheritDoc */ 351 public function singlequoteclosing() 352 { 353 return $this->trigger(__FUNCTION__, func_get_args()); 354 } 355 356 /** @inheritDoc */ 357 public function apostrophe() 358 { 359 return $this->trigger(__FUNCTION__, func_get_args()); 360 } 361 362 /** @inheritDoc */ 363 public function doublequoteopening() 364 { 365 return $this->trigger(__FUNCTION__, func_get_args()); 366 } 367 368 /** @inheritDoc */ 369 public function doublequoteclosing() 370 { 371 return $this->trigger(__FUNCTION__, func_get_args()); 372 } 373 374 /** @inheritDoc */ 375 public function camelcaselink($link, $returnonly = false) 376 { 377 return $this->trigger(__FUNCTION__, func_get_args()); 378 } 379 380 /** @inheritDoc */ 381 public function locallink($hash, $name = null, $returnonly = false) 382 { 383 return $this->trigger(__FUNCTION__, func_get_args()); 384 } 385 386 /** @inheritDoc */ 387 public function internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content') 388 { 389 return $this->trigger(__FUNCTION__, func_get_args()); 390 } 391 392 /** @inheritDoc */ 393 public function externallink($url, $name = null, $returnonly = false) 394 { 395 return $this->trigger(__FUNCTION__, func_get_args()); 396 } 397 398 /** @inheritDoc */ 399 public function interwikilink($match, $name, $wikiName, $wikiUri, $returnonly = false) 400 { 401 return $this->trigger(__FUNCTION__, func_get_args()); 402 } 403 404 /** @inheritDoc */ 405 public function windowssharelink($url, $name = null, $returnonly = false) 406 { 407 return $this->trigger(__FUNCTION__, func_get_args()); 408 } 409 410 /** @inheritDoc */ 411 public function emaillink($address, $name = null, $returnonly = false) 412 { 413 return $this->trigger(__FUNCTION__, func_get_args()); 414 } 415 416 /** @inheritDoc */ 417 public function internalmedia($src, $title = null, $align = null, $width = null, $height = null, $cache = null, $linking = null, $return = false) 418 { 419 return $this->trigger(__FUNCTION__, func_get_args()); 420 } 421 422 /** @inheritDoc */ 423 public function externalmedia($src, $title = null, $align = null, $width = null, $height = null, $cache = null, $linking = null, $return = false) 424 { 425 return $this->trigger(__FUNCTION__, func_get_args()); 426 } 427 428 /** @inheritDoc */ 429 public function rss($url, $params) 430 { 431 return $this->trigger(__FUNCTION__, func_get_args()); 432 } 433 434 /** @inheritDoc */ 435 public function table_open($maxcols = null, $numrows = null, $pos = null, $classes = null) 436 { 437 return $this->trigger(__FUNCTION__, func_get_args()); 438 } 439 440 /** @inheritDoc */ 441 public function table_close($pos = null) 442 { 443 return $this->trigger(__FUNCTION__, func_get_args()); 444 } 445 446 /** @inheritDoc */ 447 public function tablethead_open() 448 { 449 return $this->trigger(__FUNCTION__, func_get_args()); 450 } 451 452 /** @inheritDoc */ 453 public function tablethead_close() 454 { 455 return $this->trigger(__FUNCTION__, func_get_args()); 456 } 457 458 /** @inheritDoc */ 459 public function tabletbody_open() 460 { 461 return $this->trigger(__FUNCTION__, func_get_args()); 462 } 463 464 /** @inheritDoc */ 465 public function tabletbody_close() 466 { 467 return $this->trigger(__FUNCTION__, func_get_args()); 468 } 469 470 /** @inheritDoc */ 471 public function tabletfoot_open() 472 { 473 return $this->trigger(__FUNCTION__, func_get_args()); 474 } 475 476 /** @inheritDoc */ 477 public function tabletfoot_close() 478 { 479 return $this->trigger(__FUNCTION__, func_get_args()); 480 } 481 482 /** @inheritDoc */ 483 public function tablerow_open($classes = null) 484 { 485 return $this->trigger(__FUNCTION__, func_get_args()); 486 } 487 488 /** @inheritDoc */ 489 public function tablerow_close() 490 { 491 return $this->trigger(__FUNCTION__, func_get_args()); 492 } 493 494 /** @inheritDoc */ 495 public function tableheader_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) 496 { 497 return $this->trigger(__FUNCTION__, func_get_args()); 498 } 499 500 /** @inheritDoc */ 501 public function tableheader_close() 502 { 503 return $this->trigger(__FUNCTION__, func_get_args()); 504 } 505 506 /** @inheritDoc */ 507 public function tablecell_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) 508 { 509 return $this->trigger(__FUNCTION__, func_get_args()); 510 } 511 512 /** @inheritDoc */ 513 public function tablecell_close() 514 { 515 return $this->trigger(__FUNCTION__, func_get_args()); 516 } 517 518 /** @inheritDoc */ 519 public function getLastlevel() 520 { 521 return $this->trigger(__FUNCTION__, func_get_args()); 522 } 523 524 525} 526 527