Complex classes like Doku_Renderer_xhtml often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Doku_Renderer_xhtml, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
25 | class Doku_Renderer_xhtml extends Doku_Renderer { |
||
26 | /** @var array store the table of contents */ |
||
27 | public $toc = array(); |
||
28 | |||
29 | /** @var array A stack of section edit data */ |
||
30 | protected $sectionedits = array(); |
||
31 | var $date_at = ''; // link pages and media against this revision |
||
32 | |||
33 | /** @var int last section edit id, used by startSectionEdit */ |
||
34 | protected $lastsecid = 0; |
||
35 | |||
36 | /** @var array the list of headers used to create unique link ids */ |
||
37 | protected $headers = array(); |
||
38 | |||
39 | /** @var array a list of footnotes, list starts at 1! */ |
||
40 | protected $footnotes = array(); |
||
41 | |||
42 | /** @var int current section level */ |
||
43 | protected $lastlevel = 0; |
||
44 | /** @var array section node tracker */ |
||
45 | protected $node = array(0, 0, 0, 0, 0); |
||
46 | |||
47 | /** @var string temporary $doc store */ |
||
48 | protected $store = ''; |
||
49 | |||
50 | /** @var array global counter, for table classes etc. */ |
||
51 | protected $_counter = array(); // |
||
52 | |||
53 | /** @var int counts the code and file blocks, used to provide download links */ |
||
54 | protected $_codeblock = 0; |
||
55 | |||
56 | /** @var array list of allowed URL schemes */ |
||
57 | protected $schemes = null; |
||
58 | |||
59 | /** |
||
60 | * Register a new edit section range |
||
61 | * |
||
62 | * @param string $type The section type identifier |
||
63 | * @param string $title The section title |
||
64 | * @param int $start The byte position for the edit start |
||
65 | * @return string A marker class for the starting HTML element |
||
66 | * |
||
67 | * @author Adrian Lang <[email protected]> |
||
68 | */ |
||
69 | public function startSectionEdit($start, $type, $title = null, $hid = null) { |
||
73 | |||
74 | /** |
||
75 | * Finish an edit section range |
||
76 | * |
||
77 | * @param int $end The byte position for the edit end; null for the rest of the page |
||
78 | * |
||
79 | * @author Adrian Lang <[email protected]> |
||
80 | */ |
||
81 | public function finishSectionEdit($end = null, $hid = null) { |
||
95 | |||
96 | /** |
||
97 | * Returns the format produced by this renderer. |
||
98 | * |
||
99 | * @return string always 'xhtml' |
||
100 | */ |
||
101 | function getFormat() { |
||
104 | |||
105 | /** |
||
106 | * Initialize the document |
||
107 | */ |
||
108 | function document_start() { |
||
113 | |||
114 | /** |
||
115 | * Finalize the document |
||
116 | */ |
||
117 | function document_end() { |
||
170 | |||
171 | /** |
||
172 | * Add an item to the TOC |
||
173 | * |
||
174 | * @param string $id the hash link |
||
175 | * @param string $text the text to display |
||
176 | * @param int $level the nesting level |
||
177 | */ |
||
178 | function toc_additem($id, $text, $level) { |
||
186 | |||
187 | /** |
||
188 | * Render a heading |
||
189 | * |
||
190 | * @param string $text the text to display |
||
191 | * @param int $level header level |
||
192 | * @param int $pos byte position in the original source |
||
193 | */ |
||
194 | function header($text, $level, $pos) { |
||
229 | |||
230 | /** |
||
231 | * Open a new section |
||
232 | * |
||
233 | * @param int $level section level (as determined by the previous header) |
||
234 | */ |
||
235 | function section_open($level) { |
||
238 | |||
239 | /** |
||
240 | * Close the current section |
||
241 | */ |
||
242 | function section_close() { |
||
245 | |||
246 | /** |
||
247 | * Render plain text data |
||
248 | * |
||
249 | * @param $text |
||
250 | */ |
||
251 | function cdata($text) { |
||
254 | |||
255 | /** |
||
256 | * Open a paragraph |
||
257 | */ |
||
258 | function p_open() { |
||
261 | |||
262 | /** |
||
263 | * Close a paragraph |
||
264 | */ |
||
265 | function p_close() { |
||
268 | |||
269 | /** |
||
270 | * Create a line break |
||
271 | */ |
||
272 | function linebreak() { |
||
275 | |||
276 | /** |
||
277 | * Create a horizontal line |
||
278 | */ |
||
279 | function hr() { |
||
282 | |||
283 | /** |
||
284 | * Start strong (bold) formatting |
||
285 | */ |
||
286 | function strong_open() { |
||
289 | |||
290 | /** |
||
291 | * Stop strong (bold) formatting |
||
292 | */ |
||
293 | function strong_close() { |
||
296 | |||
297 | /** |
||
298 | * Start emphasis (italics) formatting |
||
299 | */ |
||
300 | function emphasis_open() { |
||
303 | |||
304 | /** |
||
305 | * Stop emphasis (italics) formatting |
||
306 | */ |
||
307 | function emphasis_close() { |
||
310 | |||
311 | /** |
||
312 | * Start underline formatting |
||
313 | */ |
||
314 | function underline_open() { |
||
317 | |||
318 | /** |
||
319 | * Stop underline formatting |
||
320 | */ |
||
321 | function underline_close() { |
||
324 | |||
325 | /** |
||
326 | * Start monospace formatting |
||
327 | */ |
||
328 | function monospace_open() { |
||
331 | |||
332 | /** |
||
333 | * Stop monospace formatting |
||
334 | */ |
||
335 | function monospace_close() { |
||
338 | |||
339 | /** |
||
340 | * Start a subscript |
||
341 | */ |
||
342 | function subscript_open() { |
||
345 | |||
346 | /** |
||
347 | * Stop a subscript |
||
348 | */ |
||
349 | function subscript_close() { |
||
352 | |||
353 | /** |
||
354 | * Start a superscript |
||
355 | */ |
||
356 | function superscript_open() { |
||
359 | |||
360 | /** |
||
361 | * Stop a superscript |
||
362 | */ |
||
363 | function superscript_close() { |
||
366 | |||
367 | /** |
||
368 | * Start deleted (strike-through) formatting |
||
369 | */ |
||
370 | function deleted_open() { |
||
373 | |||
374 | /** |
||
375 | * Stop deleted (strike-through) formatting |
||
376 | */ |
||
377 | function deleted_close() { |
||
380 | |||
381 | /** |
||
382 | * Callback for footnote start syntax |
||
383 | * |
||
384 | * All following content will go to the footnote instead of |
||
385 | * the document. To achieve this the previous rendered content |
||
386 | * is moved to $store and $doc is cleared |
||
387 | * |
||
388 | * @author Andreas Gohr <[email protected]> |
||
389 | */ |
||
390 | function footnote_open() { |
||
396 | |||
397 | /** |
||
398 | * Callback for footnote end syntax |
||
399 | * |
||
400 | * All rendered content is moved to the $footnotes array and the old |
||
401 | * content is restored from $store again |
||
402 | * |
||
403 | * @author Andreas Gohr |
||
404 | */ |
||
405 | function footnote_close() { |
||
430 | |||
431 | /** |
||
432 | * Open an unordered list |
||
433 | * |
||
434 | * @param string|string[] $classes css classes - have to be valid, do not pass unfiltered user input |
||
435 | */ |
||
436 | function listu_open($classes = null) { |
||
444 | |||
445 | /** |
||
446 | * Close an unordered list |
||
447 | */ |
||
448 | function listu_close() { |
||
451 | |||
452 | /** |
||
453 | * Open an ordered list |
||
454 | * |
||
455 | * @param string|string[] $classes css classes - have to be valid, do not pass unfiltered user input |
||
456 | */ |
||
457 | function listo_open($classes = null) { |
||
465 | |||
466 | /** |
||
467 | * Close an ordered list |
||
468 | */ |
||
469 | function listo_close() { |
||
472 | |||
473 | /** |
||
474 | * Open a list item |
||
475 | * |
||
476 | * @param int $level the nesting level |
||
477 | * @param bool $node true when a node; false when a leaf |
||
478 | */ |
||
479 | function listitem_open($level, $node=false) { |
||
483 | |||
484 | /** |
||
485 | * Close a list item |
||
486 | */ |
||
487 | function listitem_close() { |
||
490 | |||
491 | /** |
||
492 | * Start the content of a list item |
||
493 | */ |
||
494 | function listcontent_open() { |
||
497 | |||
498 | /** |
||
499 | * Stop the content of a list item |
||
500 | */ |
||
501 | function listcontent_close() { |
||
504 | |||
505 | /** |
||
506 | * Output unformatted $text |
||
507 | * |
||
508 | * Defaults to $this->cdata() |
||
509 | * |
||
510 | * @param string $text |
||
511 | */ |
||
512 | function unformatted($text) { |
||
515 | |||
516 | /** |
||
517 | * Execute PHP code if allowed |
||
518 | * |
||
519 | * @param string $text PHP code that is either executed or printed |
||
520 | * @param string $wrapper html element to wrap result if $conf['phpok'] is okff |
||
521 | * |
||
522 | * @author Andreas Gohr <[email protected]> |
||
523 | */ |
||
524 | function php($text, $wrapper = 'code') { |
||
536 | |||
537 | /** |
||
538 | * Output block level PHP code |
||
539 | * |
||
540 | * If $conf['phpok'] is true this should evaluate the given code and append the result |
||
541 | * to $doc |
||
542 | * |
||
543 | * @param string $text The PHP code |
||
544 | */ |
||
545 | function phpblock($text) { |
||
548 | |||
549 | /** |
||
550 | * Insert HTML if allowed |
||
551 | * |
||
552 | * @param string $text html text |
||
553 | * @param string $wrapper html element to wrap result if $conf['htmlok'] is okff |
||
554 | * |
||
555 | * @author Andreas Gohr <[email protected]> |
||
556 | */ |
||
557 | function html($text, $wrapper = 'code') { |
||
566 | |||
567 | /** |
||
568 | * Output raw block-level HTML |
||
569 | * |
||
570 | * If $conf['htmlok'] is true this should add the code as is to $doc |
||
571 | * |
||
572 | * @param string $text The HTML |
||
573 | */ |
||
574 | function htmlblock($text) { |
||
577 | |||
578 | /** |
||
579 | * Start a block quote |
||
580 | */ |
||
581 | function quote_open() { |
||
584 | |||
585 | /** |
||
586 | * Stop a block quote |
||
587 | */ |
||
588 | function quote_close() { |
||
591 | |||
592 | /** |
||
593 | * Output preformatted text |
||
594 | * |
||
595 | * @param string $text |
||
596 | */ |
||
597 | function preformatted($text) { |
||
600 | |||
601 | /** |
||
602 | * Display text as file content, optionally syntax highlighted |
||
603 | * |
||
604 | * @param string $text text to show |
||
605 | * @param string $language programming language to use for syntax highlighting |
||
606 | * @param string $filename file path label |
||
607 | */ |
||
608 | function file($text, $language = null, $filename = null) { |
||
611 | |||
612 | /** |
||
613 | * Display text as code content, optionally syntax highlighted |
||
614 | * |
||
615 | * @param string $text text to show |
||
616 | * @param string $language programming language to use for syntax highlighting |
||
617 | * @param string $filename file path label |
||
618 | */ |
||
619 | function code($text, $language = null, $filename = null) { |
||
622 | |||
623 | /** |
||
624 | * Use GeSHi to highlight language syntax in code and file blocks |
||
625 | * |
||
626 | * @author Andreas Gohr <[email protected]> |
||
627 | * @param string $type code|file |
||
628 | * @param string $text text to show |
||
629 | * @param string $language programming language to use for syntax highlighting |
||
630 | * @param string $filename file path label |
||
631 | */ |
||
632 | function _highlight($type, $text, $language = null, $filename = null) { |
||
672 | |||
673 | /** |
||
674 | * Format an acronym |
||
675 | * |
||
676 | * Uses $this->acronyms |
||
677 | * |
||
678 | * @param string $acronym |
||
679 | */ |
||
680 | function acronym($acronym) { |
||
693 | |||
694 | /** |
||
695 | * Format a smiley |
||
696 | * |
||
697 | * Uses $this->smiley |
||
698 | * |
||
699 | * @param string $smiley |
||
700 | */ |
||
701 | function smiley($smiley) { |
||
710 | |||
711 | /** |
||
712 | * Format an entity |
||
713 | * |
||
714 | * Entities are basically small text replacements |
||
715 | * |
||
716 | * Uses $this->entities |
||
717 | * |
||
718 | * @param string $entity |
||
719 | */ |
||
720 | function entity($entity) { |
||
727 | |||
728 | /** |
||
729 | * Typographically format a multiply sign |
||
730 | * |
||
731 | * Example: ($x=640, $y=480) should result in "640×480" |
||
732 | * |
||
733 | * @param string|int $x first value |
||
734 | * @param string|int $y second value |
||
735 | */ |
||
736 | function multiplyentity($x, $y) { |
||
739 | |||
740 | /** |
||
741 | * Render an opening single quote char (language specific) |
||
742 | */ |
||
743 | function singlequoteopening() { |
||
747 | |||
748 | /** |
||
749 | * Render a closing single quote char (language specific) |
||
750 | */ |
||
751 | function singlequoteclosing() { |
||
755 | |||
756 | /** |
||
757 | * Render an apostrophe char (language specific) |
||
758 | */ |
||
759 | function apostrophe() { |
||
763 | |||
764 | /** |
||
765 | * Render an opening double quote char (language specific) |
||
766 | */ |
||
767 | function doublequoteopening() { |
||
771 | |||
772 | /** |
||
773 | * Render an closinging double quote char (language specific) |
||
774 | */ |
||
775 | function doublequoteclosing() { |
||
779 | |||
780 | /** |
||
781 | * Render a CamelCase link |
||
782 | * |
||
783 | * @param string $link The link name |
||
784 | * @param bool $returnonly whether to return html or write to doc attribute |
||
785 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
786 | * |
||
787 | * @see http://en.wikipedia.org/wiki/CamelCase |
||
788 | */ |
||
789 | function camelcaselink($link, $returnonly = false) { |
||
796 | |||
797 | /** |
||
798 | * Render a page local link |
||
799 | * |
||
800 | * @param string $hash hash link identifier |
||
801 | * @param string $name name for the link |
||
802 | * @param bool $returnonly whether to return html or write to doc attribute |
||
803 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
804 | */ |
||
805 | function locallink($hash, $name = null, $returnonly = false) { |
||
821 | |||
822 | /** |
||
823 | * Render an internal Wiki Link |
||
824 | * |
||
825 | * $search,$returnonly & $linktype are not for the renderer but are used |
||
826 | * elsewhere - no need to implement them in other renderers |
||
827 | * |
||
828 | * @author Andreas Gohr <[email protected]> |
||
829 | * @param string $id pageid |
||
830 | * @param string|null $name link name |
||
831 | * @param string|null $search adds search url param |
||
832 | * @param bool $returnonly whether to return html or write to doc attribute |
||
833 | * @param string $linktype type to set use of headings |
||
834 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
835 | */ |
||
836 | function internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content') { |
||
918 | |||
919 | /** |
||
920 | * Render an external link |
||
921 | * |
||
922 | * @param string $url full URL with scheme |
||
923 | * @param string|array $name name for the link, array for media file |
||
924 | * @param bool $returnonly whether to return html or write to doc attribute |
||
925 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
926 | */ |
||
927 | function externallink($url, $name = null, $returnonly = false) { |
||
978 | |||
979 | /** |
||
980 | * Render an interwiki link |
||
981 | * |
||
982 | * You may want to use $this->_resolveInterWiki() here |
||
983 | * |
||
984 | * @param string $match original link - probably not much use |
||
985 | * @param string|array $name name for the link, array for media file |
||
986 | * @param string $wikiName indentifier (shortcut) for the remote wiki |
||
987 | * @param string $wikiUri the fragment parsed from the original link |
||
988 | * @param bool $returnonly whether to return html or write to doc attribute |
||
989 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
990 | */ |
||
991 | function interwikilink($match, $name = null, $wikiName, $wikiUri, $returnonly = false) { |
||
1037 | |||
1038 | /** |
||
1039 | * Link to windows share |
||
1040 | * |
||
1041 | * @param string $url the link |
||
1042 | * @param string|array $name name for the link, array for media file |
||
1043 | * @param bool $returnonly whether to return html or write to doc attribute |
||
1044 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
1045 | */ |
||
1046 | function windowssharelink($url, $name = null, $returnonly = false) { |
||
1075 | |||
1076 | /** |
||
1077 | * Render a linked E-Mail Address |
||
1078 | * |
||
1079 | * Honors $conf['mailguard'] setting |
||
1080 | * |
||
1081 | * @param string $address Email-Address |
||
1082 | * @param string|array $name name for the link, array for media file |
||
1083 | * @param bool $returnonly whether to return html or write to doc attribute |
||
1084 | * @return void|string writes to doc attribute or returns html depends on $returnonly |
||
1085 | */ |
||
1086 | function emaillink($address, $name = null, $returnonly = false) { |
||
1124 | |||
1125 | /** |
||
1126 | * Render an internal media file |
||
1127 | * |
||
1128 | * @param string $src media ID |
||
1129 | * @param string $title descriptive text |
||
1130 | * @param string $align left|center|right |
||
1131 | * @param int $width width of media in pixel |
||
1132 | * @param int $height height of media in pixel |
||
1133 | * @param string $cache cache|recache|nocache |
||
1134 | * @param string $linking linkonly|detail|nolink |
||
1135 | * @param bool $return return HTML instead of adding to $doc |
||
1136 | * @return void|string writes to doc attribute or returns html depends on $return |
||
1137 | */ |
||
1138 | function internalmedia($src, $title = null, $align = null, $width = null, |
||
1180 | |||
1181 | /** |
||
1182 | * Render an external media file |
||
1183 | * |
||
1184 | * @param string $src full media URL |
||
1185 | * @param string $title descriptive text |
||
1186 | * @param string $align left|center|right |
||
1187 | * @param int $width width of media in pixel |
||
1188 | * @param int $height height of media in pixel |
||
1189 | * @param string $cache cache|recache|nocache |
||
1190 | * @param string $linking linkonly|detail|nolink |
||
1191 | * @param bool $return return HTML instead of adding to $doc |
||
1192 | * @return void|string writes to doc attribute or returns html depends on $return |
||
1193 | */ |
||
1194 | function externalmedia($src, $title = null, $align = null, $width = null, |
||
1232 | |||
1233 | /** |
||
1234 | * Renders an RSS feed |
||
1235 | * |
||
1236 | * @param string $url URL of the feed |
||
1237 | * @param array $params Finetuning of the output |
||
1238 | * |
||
1239 | * @author Andreas Gohr <[email protected]> |
||
1240 | */ |
||
1241 | function rss($url, $params) { |
||
1324 | |||
1325 | /** |
||
1326 | * Start a table |
||
1327 | * |
||
1328 | * @param int $maxcols maximum number of columns |
||
1329 | * @param int $numrows NOT IMPLEMENTED |
||
1330 | * @param int $pos byte position in the original source |
||
1331 | * @param string|string[] $classes css classes - have to be valid, do not pass unfiltered user input |
||
1332 | */ |
||
1333 | function table_open($maxcols = null, $numrows = null, $pos = null, $classes = null) { |
||
1348 | |||
1349 | /** |
||
1350 | * Close a table |
||
1351 | * |
||
1352 | * @param int $pos byte position in the original source |
||
1353 | */ |
||
1354 | function table_close($pos = null) { |
||
1360 | |||
1361 | /** |
||
1362 | * Open a table header |
||
1363 | */ |
||
1364 | function tablethead_open() { |
||
1367 | |||
1368 | /** |
||
1369 | * Close a table header |
||
1370 | */ |
||
1371 | function tablethead_close() { |
||
1374 | |||
1375 | /** |
||
1376 | * Open a table body |
||
1377 | */ |
||
1378 | function tabletbody_open() { |
||
1381 | |||
1382 | /** |
||
1383 | * Close a table body |
||
1384 | */ |
||
1385 | function tabletbody_close() { |
||
1388 | |||
1389 | /** |
||
1390 | * Open a table footer |
||
1391 | */ |
||
1392 | function tabletfoot_open() { |
||
1395 | |||
1396 | /** |
||
1397 | * Close a table footer |
||
1398 | */ |
||
1399 | function tabletfoot_close() { |
||
1402 | |||
1403 | /** |
||
1404 | * Open a table row |
||
1405 | * |
||
1406 | * @param string|string[] $classes css classes - have to be valid, do not pass unfiltered user input |
||
1407 | */ |
||
1408 | function tablerow_open($classes = null) { |
||
1418 | |||
1419 | /** |
||
1420 | * Close a table row |
||
1421 | */ |
||
1422 | function tablerow_close() { |
||
1425 | |||
1426 | /** |
||
1427 | * Open a table header cell |
||
1428 | * |
||
1429 | * @param int $colspan |
||
1430 | * @param string $align left|center|right |
||
1431 | * @param int $rowspan |
||
1432 | * @param string|string[] $classes css classes - have to be valid, do not pass unfiltered user input |
||
1433 | */ |
||
1434 | function tableheader_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) { |
||
1454 | |||
1455 | /** |
||
1456 | * Close a table header cell |
||
1457 | */ |
||
1458 | function tableheader_close() { |
||
1461 | |||
1462 | /** |
||
1463 | * Open a table cell |
||
1464 | * |
||
1465 | * @param int $colspan |
||
1466 | * @param string $align left|center|right |
||
1467 | * @param int $rowspan |
||
1468 | * @param string|string[] $classes css classes - have to be valid, do not pass unfiltered user input |
||
1469 | */ |
||
1470 | function tablecell_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) { |
||
1490 | |||
1491 | /** |
||
1492 | * Close a table cell |
||
1493 | */ |
||
1494 | function tablecell_close() { |
||
1497 | |||
1498 | /** |
||
1499 | * Returns the current header level. |
||
1500 | * (required e.g. by the filelist plugin) |
||
1501 | * |
||
1502 | * @return int The current header level |
||
1503 | */ |
||
1504 | function getLastlevel() { |
||
1507 | |||
1508 | #region Utility functions |
||
1509 | |||
1510 | /** |
||
1511 | * Build a link |
||
1512 | * |
||
1513 | * Assembles all parts defined in $link returns HTML for the link |
||
1514 | * |
||
1515 | * @param array $link attributes of a link |
||
1516 | * @return string |
||
1517 | * |
||
1518 | * @author Andreas Gohr <[email protected]> |
||
1519 | */ |
||
1520 | function _formatLink($link) { |
||
1549 | |||
1550 | /** |
||
1551 | * Renders internal and external media |
||
1552 | * |
||
1553 | * @author Andreas Gohr <[email protected]> |
||
1554 | * @param string $src media ID |
||
1555 | * @param string $title descriptive text |
||
1556 | * @param string $align left|center|right |
||
1557 | * @param int $width width of media in pixel |
||
1558 | * @param int $height height of media in pixel |
||
1559 | * @param string $cache cache|recache|nocache |
||
1560 | * @param bool $render should the media be embedded inline or just linked |
||
1561 | * @return string |
||
1562 | */ |
||
1563 | function _media($src, $title = null, $align = null, $width = null, |
||
1666 | |||
1667 | /** |
||
1668 | * Escape string for output |
||
1669 | * |
||
1670 | * @param $string |
||
1671 | * @return string |
||
1672 | */ |
||
1673 | function _xmlEntities($string) { |
||
1676 | |||
1677 | /** |
||
1678 | * Creates a linkid from a headline |
||
1679 | * |
||
1680 | * @author Andreas Gohr <[email protected]> |
||
1681 | * @param string $title The headline title |
||
1682 | * @param boolean $create Create a new unique ID? |
||
1683 | * @return string |
||
1684 | */ |
||
1685 | function _headerToLink($title, $create = false) { |
||
1693 | |||
1694 | /** |
||
1695 | * Construct a title and handle images in titles |
||
1696 | * |
||
1697 | * @author Harry Fuecks <[email protected]> |
||
1698 | * @param string|array $title either string title or media array |
||
1699 | * @param string $default default title if nothing else is found |
||
1700 | * @param bool $isImage will be set to true if it's a media file |
||
1701 | * @param null|string $id linked page id (used to extract title from first heading) |
||
1702 | * @param string $linktype content|navigation |
||
1703 | * @return string HTML of the title, might be full image tag or just escaped text |
||
1704 | */ |
||
1705 | function _getLinkTitle($title, $default, &$isImage, $id = null, $linktype = 'content') { |
||
1722 | |||
1723 | /** |
||
1724 | * Returns HTML code for images used in link titles |
||
1725 | * |
||
1726 | * @author Andreas Gohr <[email protected]> |
||
1727 | * @param array $img |
||
1728 | * @return string HTML img tag or similar |
||
1729 | */ |
||
1730 | function _imageTitle($img) { |
||
1749 | |||
1750 | /** |
||
1751 | * helperfunction to return a basic link to a media |
||
1752 | * |
||
1753 | * used in internalmedia() and externalmedia() |
||
1754 | * |
||
1755 | * @author Pierre Spring <[email protected]> |
||
1756 | * @param string $src media ID |
||
1757 | * @param string $title descriptive text |
||
1758 | * @param string $align left|center|right |
||
1759 | * @param int $width width of media in pixel |
||
1760 | * @param int $height height of media in pixel |
||
1761 | * @param string $cache cache|recache|nocache |
||
1762 | * @param bool $render should the media be embedded inline or just linked |
||
1763 | * @return array associative array with link config |
||
1764 | */ |
||
1765 | function _getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render) { |
||
1781 | |||
1782 | /** |
||
1783 | * Embed video(s) in HTML |
||
1784 | * |
||
1785 | * @author Anika Henke <[email protected]> |
||
1786 | * @author Schplurtz le Déboulonné <[email protected]> |
||
1787 | * |
||
1788 | * @param string $src - ID of video to embed |
||
1789 | * @param int $width - width of the video in pixels |
||
1790 | * @param int $height - height of the video in pixels |
||
1791 | * @param array $atts - additional attributes for the <video> tag |
||
1792 | * @return string |
||
1793 | */ |
||
1794 | function _video($src, $width, $height, $atts = null) { |
||
1858 | |||
1859 | /** |
||
1860 | * Embed audio in HTML |
||
1861 | * |
||
1862 | * @author Anika Henke <[email protected]> |
||
1863 | * |
||
1864 | * @param string $src - ID of audio to embed |
||
1865 | * @param array $atts - additional attributes for the <audio> tag |
||
1866 | * @return string |
||
1867 | */ |
||
1868 | function _audio($src, $atts = array()) { |
||
1908 | |||
1909 | /** |
||
1910 | * _getLastMediaRevisionAt is a helperfunction to internalmedia() and _media() |
||
1911 | * which returns an existing media revision less or equal to rev or date_at |
||
1912 | * |
||
1913 | * @author lisps |
||
1914 | * @param string $media_id |
||
1915 | * @access protected |
||
1916 | * @return string revision ('' for current) |
||
1917 | */ |
||
1918 | function _getLastMediaRevisionAt($media_id){ |
||
1923 | |||
1924 | #endregion |
||
1925 | } |
||
1926 | |||
1928 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.