Page MenuHomePhabricator
Paste P17287

SpecialContentTranslation T291193
ActivePublic

Authored by Krinkle on Sep 16 2021, 10:16 PM.
diff --git a/extension.json b/extension.json
index a198a1ce..ba6a1966 100644
--- a/extension.json
+++ b/extension.json
@@ -28,23 +28,6 @@
"ExtensionMessagesFiles": {
"ContentTranslationAliases": "ContentTranslation.alias.php"
},
- "ValidSkinNames": {
- "contenttranslation": {
- "class": "SkinContentTranslation",
- "args": [
- {
- "name": "contenttranslation",
- "responsive": true,
- "styles": [
- "mw.cx.skin"
- ],
- "messages": [
- "cx-javascript"
- ]
- }
- ]
- }
- },
"HookHandlers": {
"sxbeforepublish": {
"class": "ContentTranslation\\SectionTranslationBeforePublishHandler",
diff --git a/specials/SpecialContentTranslation.php b/specials/SpecialContentTranslation.php
index 76561fd4..9c4b5981 100644
--- a/specials/SpecialContentTranslation.php
+++ b/specials/SpecialContentTranslation.php
@@ -16,7 +16,7 @@ use ExtensionRegistry;
use Html;
use MediaWiki\MediaWikiServices;
use MutableContext;
-use SkinFactory;
+use SkinContentTranslation;
use SpecialPage;
use Wikimedia\Services\NoSuchServiceException;
@@ -25,17 +25,9 @@ use Wikimedia\Services\NoSuchServiceException;
* a special page that shows Content Translation user interface.
*/
class SpecialContentTranslation extends SpecialPage {
- /**
- * @var SkinFactory
- */
- private $skinFactory;
- /**
- * @param SkinFactory $skinFactory
- */
- public function __construct( \SkinFactory $skinFactory ) {
+ public function __construct() {
parent::__construct( 'ContentTranslation' );
- $this->skinFactory = $skinFactory;
}
public function getDescription() {
@@ -55,9 +47,18 @@ class SpecialContentTranslation extends SpecialPage {
}
'@phan-var MutableContext $context';
- $context->setSkin(
- $this->skinFactory->makeSkin( 'contenttranslation' )
- );
+
+ $skin = new SkinContentTranslation( [
+ 'name' => 'contenttranslation',
+ 'responsive' => true,
+ 'styles' => [
+ 'mw.cx.skin'
+ ],
+ 'messages' => [
+ 'cx-javascript'
+ ]
+ ] );
+ $context->setSkin( $skin );
if ( !$this->canUserProceed() ) {
return;