Skip to content

Commit

Permalink
Update MediaWiki extensions to support MW 1.39
Browse files Browse the repository at this point in the history
Update the DP MediaWiki extensions to support MediaWiki 1.32 and
later, including 1.39 which is the latest LTS.
  • Loading branch information
cpeel committed Sep 5, 2023
1 parent 096f1f3 commit 5cfee60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions SETUP/MediaWiki_extensions/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MediaWiki Extensions
These MediaWiki extensions enable the use of Magic Tags to show project
information on a wiki page.
information on a wiki page. These extensions support MediaWiki 1.32 and later.

## Requirements
These assume that the MediaWiki tables and the DP tables are running in the
Expand All @@ -13,9 +13,10 @@ To use them:
1. Copy the files to your MediaWiki `extensions/` directory
2. Edit the files and update `$relPath` to point to your DP `c/pinc/` directory
3. Add the following lines to your MediaWiki `LocalSettings.php` file:

```php
require_once('extensions/dpExtensions.php');
require_once('extensions/hospitalExtensions.php');
```

## Magic Tags provided
The following magic tags are provided:
Expand Down
8 changes: 4 additions & 4 deletions SETUP/MediaWiki_extensions/dpExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

function wfPgFormats()
{
global $wgParser;
$wgParser->setHook("pg_formats", "getPgFormats");
$parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
$parser->setHook("pg_formats", "getPgFormats");
}

function getPgFormats($input, $argv)
Expand Down Expand Up @@ -85,8 +85,8 @@ function getPgFormats($input, $argv)

function wfProjectInfo()
{
global $wgParser;
$wgParser->setHook("projectinfo", "showProjectInfo");
$parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
$parser->setHook("projectinfo", "showProjectInfo");
}

function showProjectInfo($input, $argv, $parser)
Expand Down
4 changes: 2 additions & 2 deletions SETUP/MediaWiki_extensions/hospitalExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

function wfHospitalInfo()
{
global $wgParser;
$wgParser->setHook("hospital_info", "listHospitalProjects");
$parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
$parser->setHook("hospital_info", "listHospitalProjects");
}

function listHospitalProjects($input, $argv)
Expand Down

0 comments on commit 5cfee60

Please sign in to comment.