File tree Expand file tree Collapse file tree
SETUP/MediaWiki_extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# MediaWiki Extensions
22These MediaWiki extensions enable the use of Magic Tags to show project
3- information on a wiki page.
3+ information on a wiki page. These extensions support MediaWiki 1.32 and later.
44
55## Requirements
66These assume that the MediaWiki tables and the DP tables are running in the
@@ -13,9 +13,10 @@ To use them:
13131 . Copy the files to your MediaWiki ` extensions/ ` directory
14142 . Edit the files and update ` $relPath ` to point to your DP ` c/pinc/ ` directory
15153 . Add the following lines to your MediaWiki ` LocalSettings.php ` file:
16-
16+ ``` php
1717 require_once('extensions/dpExtensions.php');
1818 require_once('extensions/hospitalExtensions.php');
19+ ```
1920
2021## Magic Tags provided
2122The following magic tags are provided:
Original file line number Diff line number Diff line change 3434
3535function wfPgFormats ()
3636{
37- global $ wgParser ;
38- $ wgParser ->setHook ("pg_formats " , "getPgFormats " );
37+ $ parser = \ MediaWiki \MediaWikiServices:: getInstance ()-> getParser () ;
38+ $ parser ->setHook ("pg_formats " , "getPgFormats " );
3939}
4040
4141function getPgFormats ($ input , $ argv )
@@ -85,8 +85,8 @@ function getPgFormats($input, $argv)
8585
8686function wfProjectInfo ()
8787{
88- global $ wgParser ;
89- $ wgParser ->setHook ("projectinfo " , "showProjectInfo " );
88+ $ parser = \ MediaWiki \MediaWikiServices:: getInstance ()-> getParser () ;
89+ $ parser ->setHook ("projectinfo " , "showProjectInfo " );
9090}
9191
9292function showProjectInfo ($ input , $ argv , $ parser )
Original file line number Diff line number Diff line change 3333
3434function wfHospitalInfo ()
3535{
36- global $ wgParser ;
37- $ wgParser ->setHook ("hospital_info " , "listHospitalProjects " );
36+ $ parser = \ MediaWiki \MediaWikiServices:: getInstance ()-> getParser () ;
37+ $ parser ->setHook ("hospital_info " , "listHospitalProjects " );
3838}
3939
4040function listHospitalProjects ($ input , $ argv )
You can’t perform that action at this time.
0 commit comments