11<?php
2+
3+ use dokuwiki \Extension \SyntaxPlugin ;
4+
25/**
36 * Include plugin (footer component)
47 *
58 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
69 * @author Michael Klier <[email protected] > 710 */
811
9- class syntax_plugin_include_footer extends DokuWiki_Syntax_Plugin {
10-
11- function getType () {
12+ class syntax_plugin_include_footer extends SyntaxPlugin
13+ {
14+ public function getType ()
15+ {
1216 return 'formatting ' ;
1317 }
1418
15- function getSort () {
19+ public function getSort ()
20+ {
1621 return 300 ;
1722 }
1823
19- function handle ($ match , $ state , $ pos , Doku_Handler $ handler ) {
24+ public function handle ($ match , $ state , $ pos , Doku_Handler $ handler )
25+ {
2026 // this is a syntax plugin that doesn't offer any syntax, so there's nothing to handle by the parser
2127 }
2228
@@ -26,13 +32,14 @@ function handle($match, $state, $pos, Doku_Handler $handler) {
2632 * Code heavily copied from the header renderer from inc/parser/xhtml.php, just
2733 * added an href parameter to the anchor tag linking to the wikilink.
2834 */
29- function render ($ mode , Doku_Renderer $ renderer , $ data ) {
35+ public function render ($ mode , Doku_Renderer $ renderer , $ data )
36+ {
3037
31- list ( $ page , $ sect , $ sect_title , $ flags , $ redirect_id , $ footer_lvl) = $ data ;
38+ [ $ page , $ sect , $ sect_title , $ flags , $ redirect_id , $ footer_lvl] = $ data ;
3239
3340 if ($ mode == 'xhtml ' ) {
3441 $ renderer ->doc .= $ this ->html_footer ($ page , $ sect , $ sect_title , $ flags , $ footer_lvl , $ renderer );
35- return true ;
42+ return true ;
3643 }
3744 return false ;
3845 }
@@ -42,37 +49,31 @@ function render($mode, Doku_Renderer $renderer, $data) {
4249 * @param $renderer Doku_Renderer_xhtml The (xhtml) renderer
4350 * @return string The HTML code of the footer
4451 */
45- function html_footer ($ page , $ sect , $ sect_title , $ flags , $ footer_lvl , &$ renderer ) {
52+ public function html_footer ($ page , $ sect , $ sect_title , $ flags , $ footer_lvl , &$ renderer )
53+ {
4654 global $ conf , $ ID ;
4755
48- if (!$ flags ['footer ' ]) return '' ;
56+ if (!$ flags ['footer ' ]) return '' ;
4957
5058 $ meta = p_get_metadata ($ page );
5159 $ exists = page_exists ($ page );
52- $ xhtml = array () ;
60+ $ xhtml = [] ;
5361 // permalink
5462 if ($ flags ['permalink ' ]) {
5563 $ class = ($ exists ? 'wikilink1 ' : 'wikilink2 ' );
5664 $ url = ($ sect ) ? wl ($ page ) . '# ' . $ sect : wl ($ page );
5765 $ name = ($ sect ) ? $ sect_title : $ page ;
5866 $ title = ($ sect ) ? $ page . '# ' . $ sect : $ page ;
5967 if (!$ title ) $ title = str_replace ('_ ' , ' ' , noNS ($ page ));
60- $ link = array (
61- 'url ' => $ url ,
62- 'title ' => $ title ,
63- 'name ' => $ name ,
64- 'target ' => $ conf ['target ' ]['wiki ' ],
65- 'class ' => $ class . ' permalink ' ,
66- 'more ' => 'rel="bookmark" ' ,
67- );
68+ $ link = ['url ' => $ url , 'title ' => $ title , 'name ' => $ name , 'target ' => $ conf ['target ' ]['wiki ' ], 'class ' => $ class . ' permalink ' , 'more ' => 'rel="bookmark" ' ];
6869 $ xhtml [] = $ renderer ->_formatLink ($ link );
6970 }
7071
7172 // date
7273 if ($ flags ['date ' ] && $ exists ) {
7374 $ date = $ meta ['date ' ]['created ' ];
7475 if ($ date ) {
75- $ xhtml [] = '<abbr class="published" title=" ' . dformat ($ date , '%Y-%m-%dT%H:%M:%SZ ' ). '"> '
76+ $ xhtml [] = '<abbr class="published" title=" ' . dformat ($ date , '%Y-%m-%dT%H:%M:%SZ ' ) . '"> '
7677 . dformat ($ date )
7778 . '</abbr> ' ;
7879 }
@@ -82,7 +83,7 @@ function html_footer($page, $sect, $sect_title, $flags, $footer_lvl, &$renderer)
8283 if ($ flags ['mdate ' ] && $ exists ) {
8384 $ mdate = $ meta ['date ' ]['modified ' ];
8485 if ($ mdate ) {
85- $ xhtml [] = '<abbr class="published" title=" ' . dformat ($ mdate , '%Y-%m-%dT%H:%M:%SZ ' ). '"> '
86+ $ xhtml [] = '<abbr class="published" title=" ' . dformat ($ mdate , '%Y-%m-%dT%H:%M:%SZ ' ) . '"> '
8687 . dformat ($ mdate )
8788 . '</abbr> ' ;
8889 }
@@ -117,7 +118,7 @@ function html_footer($page, $sect, $sect_title, $flags, $footer_lvl, &$renderer)
117118 // tags - let Tag Plugin do the work for us
118119 if (empty ($ sect ) && $ flags ['tags ' ] && (!plugin_isdisabled ('tag ' )) && ($ tag = plugin_load ('helper ' , 'tag ' ))) {
119120 $ tags = $ tag ->td ($ page );
120- if ($ tags ) {
121+ if ($ tags ) {
121122 $ xhtml .= '<div class="tags"><span> ' . DOKU_LF
122123 . DOKU_TAB . $ tags . DOKU_LF
123124 . DOKU_TAB . '</span></div> ' . DOKU_LF ;
0 commit comments