<?php
-$wgHooks['ParserFirstCallInit'][] = 'efSetupPaypalWMES';
-
-function efSetupPaypalWMES(&$parser) {
- $parser->setHook( 'paypal wm-es', 'efHookPaypalWMES' );
- return true;
-}
-
-function efHookPaypalWMES( $input, array $args, Parser $parser, PPFrame $frame ) {
- global $wgExtensionAssetsPath;
- return '
-<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input name="cmd" type="hidden" value="_s-xclick" />
-<input name="hosted_button_id" type="hidden" value="G5QN39QKQGMNE" />
-<input alt="PayPal. La forma rápida y segura de pagar en Internet." name="submit"
-src="' . htmlspecialchars( "$wgExtensionAssetsPath/Paypal-wmes/PayPal_button.gif" ) . '" type="image" />
-</form>';
-}
+$wgHooks['ParserFirstCallInit'][] = 'PaypalWMES::setup';
+$wgAutoloadClasses['PaypalWMES'] = __DIR__ . "/Paypal-wmes_body.php";
--- /dev/null
+<?php
+
+class PaypalWMES {
+ public static function setup(&$parser) {
+ $parser->setHook( 'paypal wm-es', 'PaypalWMES::hook' );
+ return true;
+ }
+
+ public static function hook( $input, array $args, Parser $parser, PPFrame $frame ) {
+ global $wgExtensionAssetsPath;
+ return '
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input name="cmd" type="hidden" value="_s-xclick" />
+<input name="hosted_button_id" type="hidden" value="G5QN39QKQGMNE" />
+<input alt="PayPal. La forma rápida y segura de pagar en Internet." name="submit"
+src="' . htmlspecialchars( "$wgExtensionAssetsPath/Paypal-wmes/PayPal_button.gif" ) . '" type="image" />
+</form>';
+ }
+}
+