<?php
/**
+ * Resource loader module for user tokens.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
/**
* Fetch the tokens for the current user.
- *
+ *
* @param $context ResourceLoaderContext: Context object
* @return Array: List of tokens keyed by token type
*/
global $wgUser;
return array(
- 'editToken' => $wgUser->edittoken(),
- 'watchToken' => ApiQueryInfo::getWatchToken(),
+ 'editToken' => $wgUser->getEditToken(),
+ 'watchToken' => ApiQueryInfo::getWatchToken(null, null),
);
}
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
- return Xml::encodeJsCall( 'mw.user.tokens.set',
+ return Xml::encodeJsCall( 'mw.user.tokens.set',
array( $this->contextUserTokens( $context ) ) );
}
+ /**
+ * @return bool
+ */
+ public function supportsURLLoading() {
+ return false;
+ }
+
/**
* @return string
*/