SHARE
TWEET

Untitled

a guest Sep 5th, 2017 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //FirstRevision.i18n.magic.php
  2. <?php
  3. $magicWords = array();
  4.  
  5. $magicWords['en'] = array(
  6.     // magic ID
  7.     'FIRSTREVISION' => array(1, 'FIRSTREVISION'),
  8. );
  9.  
  10.  
  11. //FirstRevision.php
  12. <?php
  13. if (!defined('MEDIAWIKI')) {
  14.     die();
  15. }
  16.  
  17. $wgExtensionMessagesFiles['FirstRevisionMagic'] = __DIR__ . '/FirstRevision.i18n.magic.php';
  18.  
  19. $wgHooks['ParserGetVariableValueSwitch'][] = 'wfMyAssignAValue';
  20. function wfMyAssignAValue(&$parser, &$cache, &$magicWordId, &$ret) {
  21.     if ($magicWordId == 'FIRSTREVISION') {
  22.         $ret = 'test';
  23.     }
  24.     return true;
  25. }
  26.  
  27. $wgHooks['MagicWordwgVariableIDs'][] = 'wfMyDeclareVarIds';
  28. function wfMyDeclareVarIds(&$customVariableIds) {
  29.     $customVariableIds[] = 'FIRSTREVISION';
  30.     return true;
  31. }
  32.  
  33. $wgExtensionCredits['parserhook'][] = array(
  34.     'path' => __FILE__,
  35.     'name' => 'FirstRevision',
  36.     'version' => '0.1',
  37.     'author' => 'asd',
  38.     'descriptionmsg' => 'descriptionmsg',
  39. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top