protected $modifiedTime = array();
+ protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
+
/* Methods */
+ /**
+ * @param $context ResourceLoaderContext
+ * @return array|int|Mixed
+ */
public function getModifiedTime( ResourceLoaderContext $context ) {
$hash = $context->getHash();
if ( isset( $this->modifiedTime[$hash] ) ) {
global $wgUser;
if ( $context->getUser() === $wgUser->getName() ) {
- return $this->modifiedTime[$hash] = $wgUser->getTouched();
+ return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
} else {
return 1;
}
}
}
+ /**
+ * @param $context ResourceLoaderContext
+ * @return string
+ */
public function getScript( ResourceLoaderContext $context ) {
- return Xml::encodeJsCall( 'mediaWiki.user.options.set',
+ return Xml::encodeJsCall( 'mw.user.options.set',
array( $this->contextUserOptions( $context ) ) );
}
+ /**
+ * @param $context ResourceLoaderContext
+ * @return array
+ */
public function getStyles( ResourceLoaderContext $context ) {
+ // FIXME: This stuff should really be in its own module, because it gets double-loaded otherwise
+ // (once through a <link>, once when embedded as JS)
global $wgAllowUserCssPrefs;
if ( $wgAllowUserCssPrefs ) {
// Build CSS rules
$rules = array();
+
+ // Underline: 2 = browser default, 1 = always, 0 = never
if ( $options['underline'] < 2 ) {
$rules[] = "a { text-decoration: " .
( $options['underline'] ? 'underline' : 'none' ) . "; }";
return array();
}
- public function getFlip( $context ) {
- global $wgContLang;
-
- return $wgContLang->getDir() !== $context->getDirection();
- }
-
+ /**
+ * @return string
+ */
public function getGroup() {
return 'private';
}
+
+ public function getDependencies() {
+ return array( 'mediawiki.user' );
+ }
}