Santhosh has submitted this change and it was merged.

Change subject: Add special page Special:ContentTranslation
......................................................................


Add special page Special:ContentTranslation

Change-Id: I59a1349ad3a9ca0a044165dc870b2aef15ca3ed3
---
A Autoload.php
A ContentTranslation.alias.php
M ContentTranslation.php
A specials/SpecialContentTranslation.php
4 files changed, 85 insertions(+), 2 deletions(-)

Approvals:
  Santhosh: Verified; Looks good to me, approved
  Siebrand: Looks good to me, but someone else must approve



diff --git a/Autoload.php b/Autoload.php
new file mode 100644
index 0000000..973707c
--- /dev/null
+++ b/Autoload.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Autoload definitions.
+ *
+ * @file
+ * @copyright 2014 ContentTranslation Team and others; see AUTHORS.txt
+ * @license GPL-2.0+; see LICENSE.txt
+ */
+
+$dir =__DIR__;
+
+$wgAutoloadClasses['SpecialContentTranslation'] = 
"$dir/specials/SpecialContentTranslation.php";
diff --git a/ContentTranslation.alias.php b/ContentTranslation.alias.php
new file mode 100644
index 0000000..0b53484
--- /dev/null
+++ b/ContentTranslation.alias.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Special page aliases for extension ContentTranslation.
+ *
+ * @file
+ * @ingroup Extensions
+ * @copyright 2014 ContentTranslation Team and others; see AUTHORS.txt
+ * @license GPL-2.0+; see LICENSE.txt
+ */
+
+$specialPageAliases = array();
+
+/** English (English) */
+$specialPageAliases['en'] = array(
+       'ContentTranslation' => array( 'ContentTranslation' ),
+);
+
+/** Malayalam (മലയാളം) */
+$specialPageAliases['ml'] = array(
+       'ContentTranslation' => array( 'ലേഖനപരിഭാഷ' ),
+);
diff --git a/ContentTranslation.php b/ContentTranslation.php
index 815939a..768ce70 100644
--- a/ContentTranslation.php
+++ b/ContentTranslation.php
@@ -37,6 +37,13 @@
        'url' => 'https://www.mediawiki.org/wiki/Extension:ContentTranslation',
 );
 
-require __DIR__ . '/Resources.php';
+$dir = __DIR__;
 
-$wgMessagesDirs['ContentTranslation'] = __DIR__ . "/i18n/";
\ No newline at end of file
+require_once "$dir/Resources.php";
+require_once "$dir/Autoload.php";
+
+$GLOBALS['wgMessagesDirs']['ContentTranslation'] = __DIR__ . "/i18n";
+$GLOBALS['wgMessagesDirs']['ContentTranslationAlias'] = __DIR__ . 
"/ContentTranslation.alias.php";
+
+// Special pages
+$wgSpecialPages['ContentTranslation'] = 'SpecialContentTranslation';
diff --git a/specials/SpecialContentTranslation.php 
b/specials/SpecialContentTranslation.php
new file mode 100644
index 0000000..23b619c
--- /dev/null
+++ b/specials/SpecialContentTranslation.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Contains special page Special:ContentTranslation.
+ *
+ * @file
+ * @copyright 2014 ContentTranslation Team and others; see AUTHORS.txt
+ * @license GPL-2.0+; see LICENSE.txt
+ */
+
+/**
+ * Implements the core of Content Translation extension - a special page which
+ * shows Content Translation user interface.
+ * @ingroup SpecialPage
+ */
+class SpecialContentTranslation extends SpecialPage {
+       function __construct() {
+               parent::__construct( 'ContentTranslation' );
+       }
+
+       public function getDescription() {
+               return $this->msg( 'ct' )->text();
+       }
+
+       public function execute( $parameters ) {
+               $out = $this->getOutput();
+               $skin = $this->getSkin();
+               $this->setHeaders();
+               $out->setArticleBodyOnly( true );
+               // Default modules copied from OutputPage::addDefaultModules
+               $out->addModules( array(
+                       'mediawiki.user',
+                       'mediawiki.page.startup',
+                       'mediawiki.page.ready',
+               ) );
+
+               $out->addHTML( $out->headElement( $skin ) );
+               // Enable this if you need useful debugging information
+               // $out->addHtml( MWDebug::getDebugHTML( $this->getContext() ) 
);
+               wfRunHooks( 'BeforePageDisplay', array( &$out, &$skin ) );
+               $out->addHTML( $skin->bottomScripts() );
+               $out->addHTML( '</body></html>' );
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/106214
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I59a1349ad3a9ca0a044165dc870b2aef15ca3ed3
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: KartikMistry <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: SuchetaG <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to