From 0a130482b4a23c2497f3a9cc6e0c2878416c4721 Mon Sep 17 00:00:00 2001 From: Platonides Date: Sun, 7 Jan 2018 22:11:49 +0100 Subject: [PATCH] Move from function globals to a class --- Paypal-wmes.php | 19 ++----------------- Paypal-wmes_body.php | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) mode change 100755 => 100644 Paypal-wmes.php create mode 100755 Paypal-wmes_body.php diff --git a/Paypal-wmes.php b/Paypal-wmes.php old mode 100755 new mode 100644 index 38e4f6d..495b3c4 --- a/Paypal-wmes.php +++ b/Paypal-wmes.php @@ -1,19 +1,4 @@ setHook( 'paypal wm-es', 'efHookPaypalWMES' ); - return true; -} - -function efHookPaypalWMES( $input, array $args, Parser $parser, PPFrame $frame ) { - global $wgExtensionAssetsPath; - return ' -
- - - -
'; -} +$wgHooks['ParserFirstCallInit'][] = 'PaypalWMES::setup'; +$wgAutoloadClasses['PaypalWMES'] = __DIR__ . "/Paypal-wmes_body.php"; diff --git a/Paypal-wmes_body.php b/Paypal-wmes_body.php new file mode 100755 index 0000000..df96700 --- /dev/null +++ b/Paypal-wmes_body.php @@ -0,0 +1,20 @@ +setHook( 'paypal wm-es', 'PaypalWMES::hook' ); + return true; + } + + public static function hook( $input, array $args, Parser $parser, PPFrame $frame ) { + global $wgExtensionAssetsPath; + return ' +
+ + + +
'; + } +} + -- 2.30.2