KartikMistry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/106214
Change subject: Add special page Special:ContentTranslation
......................................................................
Add special page Special:ContentTranslation
Change-Id: I59a1349ad3a9ca0a044165dc870b2aef15ca3ed3
---
A _autoload.php
A specials/ContentTranslationSpecialPage.php
A specials/SpecialContentTranslation.php
3 files changed, 82 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/14/106214/1
diff --git a/_autoload.php b/_autoload.php
new file mode 100644
index 0000000..7c2dea7
--- /dev/null
+++ b/_autoload.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Autoload definitions.
+ *
+ * @file
+ * @author Kartik Mistry
+ * @copyright Copyright © 2014, Kartik Mistry
+ * @license GPL-2.0+
+ */
+
+/** @cond file_level_code */
+global $wgAutoloadClasses;
+$dir = dirname( __FILE__ );
+/** @endcond */
+
+/**
+ * @name "Special pages"
+ * Special pages in content translation.
+ * @{
+ */
+$wgAutoloadClasses['ContentTranslationSpecialPage'] =
+ "$dir/specials/ContentTranslationSpecialPage.php";
+$wgAutoloadClasses['SpecialContentTranslation'] =
+ "$dir/specials/SpecialContentTranslation.php";
+/**@}*/
+
diff --git a/specials/ContentTranslationSpecialPage.php
b/specials/ContentTranslationSpecialPage.php
new file mode 100644
index 0000000..a0084f2
--- /dev/null
+++ b/specials/ContentTranslationSpecialPage.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Contains logic for all special pages of the ContentTranslation extension
+ *
+ * @file
+ * @author Kartik Mistry
+ * @copyright Copyright © 2014 Kartik Mistry
+ * @license GPL-2.0+
+ */
+
+/**
+ * A special page that all special pages of the Content Translation extension
+ * should use.
+ *
+ * @ingroup SpecialPage ContentTranslationSpecialPage
+ */
+class ContentTranslationSpecialPage extends SpecialPage {
+ /**
+ * Get a self-referential title object
+ *
+ * For backward compatibility for
https://gerrit.wikimedia.org/r/#/c/103587.
+ * Should be removed when the lowest supported version is MediaWiki
1.23.
+ *
+ * @param string|bool $subpage
+ * @return Title|void
+ */
+ public function getTitle( $subpage = false ) {
+ if ( method_exists( $this, 'getPageTitle' ) ) {
+ return $this->getPageTitle();
+ } else {
+ return self::getTitleFor( $this->mName, $subpage );
+ }
+ }
+}
diff --git a/specials/SpecialContentTranslation.php
b/specials/SpecialContentTranslation.php
new file mode 100644
index 0000000..c1d0d2a
--- /dev/null
+++ b/specials/SpecialContentTranslation.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Contains special page Special:ContentTranslation.
+ *
+ * @file
+ * @author Kartik Mistry
+ * @copyright Copyright © 2014 Kartik Mistry
+ * @license GPL-2.0+
+ */
+
+/**
+ * Implements the core of Content Translation extension - a special page which
+ * shows Content Translation user interface.
+ *
+ * @ingroup SpecialPage ContentTranslationSpecialPage
+ */
+class SpecialContentTranslation extends ContentTranslationSpecialPage {
+
+ function __construct() {
+ parent::__construct( 'ContentTranslation' );
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/106214
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59a1349ad3a9ca0a044165dc870b2aef15ca3ed3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: KartikMistry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits