/** * Register FlaggedRevs source code paths. * * @return void */ public static function setConditionalHooks() { global $wgHooks, $wgFlaggedRevsProtection; # Give bots the 'autoreview' right (here so it triggers after CentralAuth) # @TODO: better way to ensure hook order $wgHooks['UserGetRights'][] = 'FlaggedRevsHooks::onUserGetRights'; if ($wgFlaggedRevsProtection) { # Add pending changes related magic words $wgHooks['ParserFirstCallInit'][] = 'FlaggedRevsHooks::onParserFirstCallInit'; $wgHooks['ParserGetVariableValueSwitch'][] = 'FlaggedRevsHooks::onParserGetVariableValueSwitch'; $wgHooks['MagicWordwgVariableIDs'][] = 'FlaggedRevsHooks::onMagicWordwgVariableIDs'; } $wgHooks['EchoGetDefaultNotifiedUsers'][] = 'FlaggedRevsHooks::onEchoGetDefaultNotifiedUsers'; # ######## User interface ######### FlaggedRevsUISetup::defineHookHandlers($wgHooks); # ######## }
/** * Register FlaggedRevs source code paths. * * @return void */ public static function setConditionalHooks() { global $wgHooks, $wgFlaggedRevsProtection; # Give bots the 'autoreview' right (here so it triggers after CentralAuth) # @TODO: better way to ensure hook order $wgHooks['UserGetRights'][] = 'FlaggedRevsHooks::onUserGetRights'; if ($wgFlaggedRevsProtection) { # Add pending changes related magic words $wgHooks['ParserFirstCallInit'][] = 'FlaggedRevsHooks::onParserFirstCallInit'; // @todo FIXME: Use $wgExtensionMessagesFiles instead of LanguageGetMagic hook. $wgHooks['LanguageGetMagic'][] = 'FlaggedRevsHooks::onLanguageGetMagic'; $wgHooks['ParserGetVariableValueSwitch'][] = 'FlaggedRevsHooks::onParserGetVariableValueSwitch'; $wgHooks['MagicWordwgVariableIDs'][] = 'FlaggedRevsHooks::onMagicWordwgVariableIDs'; } # ######## User interface ######### FlaggedRevsUISetup::defineHookHandlers($wgHooks); # ######## }