<?php
/**
- *
- *
- * Created on Apr 15, 2012
- *
* Copyright © 2012 Szymon Świerkosz beau@adres.pl
*
* This program is free software; you can redistribute it and/or modify
* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* API module that facilitates the changing of user's preferences.
* Requires API write mode to be enabled.
$this->dieWithError( 'apierror-nochanges' );
}
- $prefs = Preferences::getPreferences( $user, $this->getContext() );
+ $preferencesFactory = MediaWikiServices::getInstance()->getPreferencesFactory();
+ $prefs = $preferencesFactory->getFormDescriptor( $user, $this->getContext() );
$prefsKinds = $user->getOptionKinds( $this->getContext(), $changes );
$htmlForm = null;
$user->setOption( $key, $value );
$changed = true;
} else {
- $this->addWarning( [ 'apiwarn-validationfailed', wfEscapeWikitext( $key ), $validation ] );
+ $this->addWarning( [ 'apiwarn-validationfailed', wfEscapeWikiText( $key ), $validation ] );
}
}