diff --git a/Connected.i18n.magic.php b/Connected.i18n.magic.php index 4d5f911ced5cdb91b82f694ab123f511c0c48835..8f75fd63a2a2cd4a575024c42be42f784137a8d9 100755 --- a/Connected.i18n.magic.php +++ b/Connected.i18n.magic.php @@ -2,7 +2,7 @@ $magicWords = []; $magicWords['en'] = [ - 'connected' => [1, 'LOGGEDIN'], - 'u_name' => [1, 'USERNAME'], + /*'connected' => [1, 'LOGGEDIN'], + 'u_name' => [1, 'USERNAME'],*/ 'iflogged' => [0, 'ifloggedin'] ]; diff --git a/extension.json b/extension.json index 555a7f03255f233cefa0acd100cd2274dbe79fea..8fd1811689e11129679781b319f263102027f3f9 100644 --- a/extension.json +++ b/extension.json @@ -13,8 +13,7 @@ "ExampleExtensionMagic": "Connected.i18n.magic.php" }, "Hooks": { - "ParserGetVariableValueSwitch": "ConnectedHooks::onParserFirstCallInit", - "MagicWordwgVariableIDs": "ConnectedHooks::connectedDeclareVarIds" + "ParserFirstCallInit": "ConnectedHooks::onParserFirstCallInit" }, "manifest_version": 1 } diff --git a/src/Connected.php b/src/Connected.php index cefbd88ad561d9ce08b3030768ac373545aa4757..413ceec6d56b0468a610284cdec4661ded5c9a3d 100755 --- a/src/Connected.php +++ b/src/Connected.php @@ -12,13 +12,15 @@ class ConnectedHooks { public static function onParserFirstCallInit( Parser $parser ) { // Create a function hook associating the "example" magic word with renderExample() - $parser->setFunctionHook( 'ifloggedin', [ self::class, 'ifConnectedRender' ] ); + $parser->setFunctionHook( 'iflogged', [ self::class, 'ifConnectedRender' ] ); } // Render the output of {{#example:}}. public static function ifConnectedRender( Parser $parser, $ifLoggedIn = '', $ifNot = '') { // The input parameters are wikitext with templates expanded. // The output should be wikitext too. + $output = "ok";/**/ + /* global $wgUser; if($wgUser->isSafeToLoad()){ if ( $wgUser->isLoggedIn() ) { @@ -27,9 +29,14 @@ class ConnectedHooks { else{ $output = $ifNot; } - + }*/ return $output; } +} +/* Removed Hooks +, +"ParserGetVariableValueSwitch": "ConnectedHooks::onParserFirstCallInit", +"MagicWordwgVariableIDs": "ConnectedHooks::connectedDeclareVarIds" public static function wfConnectedAssignValue( Parser $parser, &$cache, &$magicWordId, &$ret ) { global $wgUser; @@ -68,7 +75,4 @@ class ConnectedHooks { // variable IDs. We oblige by adding ours: $customVariableIds[] = 'connected'; $customVariableIds[] = 'u_name'; - } -} - -$wgHooks['MagicWordwgVariableIDs'][] = 'connectedMyDeclareVarIds'; + }*/