Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/174920
Change subject: Remove code related to SkinTemplateTabs hook
......................................................................
Remove code related to SkinTemplateTabs hook
The hook was removed in MW 1.18
Change-Id: Ia5848b49c7b73c08c4400e1db9e046bd7ed1707b
---
M LiquidThreads.php
M classes/Dispatch.php
M classes/View.php
M pages/IndividualThreadHistoryView.php
M pages/TalkpageHeaderView.php
M pages/TalkpageHistoryView.php
M pages/TalkpageView.php
M pages/ThreadDiffView.php
M pages/ThreadHistoryListingView.php
M pages/ThreadPermalinkView.php
M pages/ThreadProtectionFormView.php
11 files changed, 2 insertions(+), 128 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads
refs/changes/20/174920/1
diff --git a/LiquidThreads.php b/LiquidThreads.php
index e6ca056..076472a 100644
--- a/LiquidThreads.php
+++ b/LiquidThreads.php
@@ -109,7 +109,6 @@
// Main dispatch hook
$wgHooks['MediaWikiPerformAction'][] = 'LqtDispatch::tryPage';
-$wgHooks['SkinTemplateTabs'][] = 'LqtDispatch::onSkinTemplateTabs';
$wgHooks['SkinTemplateNavigation'][] = 'LqtDispatch::onSkinTemplateNavigation';
$wgHooks['PageContentLanguage'][] = 'LqtDispatch::onPageContentLanguage';
diff --git a/classes/Dispatch.php b/classes/Dispatch.php
index 5a26631..ca79fee 100644
--- a/classes/Dispatch.php
+++ b/classes/Dispatch.php
@@ -235,14 +235,6 @@
return true;
}
- static function onSkinTemplateTabs( $skinTemplate, &$links ) {
- if ( !self::$primaryView ) return true;
-
- self::$primaryView->customizeTabs( $skinTemplate, $links );
-
- return true;
- }
-
/**
* Most stuff is in the user language.
* @param $title Title
diff --git a/classes/View.php b/classes/View.php
index 95b54a3..b1101b6 100644
--- a/classes/View.php
+++ b/classes/View.php
@@ -2380,10 +2380,6 @@
return $sig;
}
- function customizeTabs( $skin, &$links ) {
- // No-op
- }
-
function customizeNavigation( $skin, &$links ) {
// No-op
}
diff --git a/pages/IndividualThreadHistoryView.php
b/pages/IndividualThreadHistoryView.php
index be88b2f..0a6bf8f 100644
--- a/pages/IndividualThreadHistoryView.php
+++ b/pages/IndividualThreadHistoryView.php
@@ -3,12 +3,6 @@
class IndividualThreadHistoryView extends ThreadPermalinkView {
protected $oldid;
- function customizeTabs( $skintemplate, &$content_actions ) {
- $content_actions['history']['class'] = 'selected';
- parent::customizeTabs( $skintemplate, $content_actions );
- return true;
- }
-
function customizeNavigation( $skin, &$links ) {
$links['views']['history']['class'] = 'selected';
parent::customizeNavigation( $skin, $links );
diff --git a/pages/TalkpageHeaderView.php b/pages/TalkpageHeaderView.php
index 3007946..f1909e5 100644
--- a/pages/TalkpageHeaderView.php
+++ b/pages/TalkpageHeaderView.php
@@ -3,21 +3,6 @@
// Pass-through wrapper with an extra note at the top
class TalkpageHeaderView extends LqtView {
- function customizeTabs( $skintemplate, &$content_actions ) {
- unset( $content_actions['edit'] );
- unset( $content_actions['addsection'] );
- unset( $content_actions['history'] );
- unset( $content_actions['watch'] );
- unset( $content_actions['move'] );
-
- $content_actions['talk']['class'] = false;
- $content_actions['header'] = array(
- 'class' => 'selected',
- 'text' => wfMessage( 'lqt-talkpage-history-tab'
)->text(),
- 'href' => '',
- );
- }
-
function customizeNavigation( $skin, &$links ) {
$remove = array(
'actions/edit',
diff --git a/pages/TalkpageHistoryView.php b/pages/TalkpageHistoryView.php
index 4d9be65..60b58cf 100644
--- a/pages/TalkpageHistoryView.php
+++ b/pages/TalkpageHistoryView.php
@@ -20,12 +20,6 @@
return false;
}
- function customizeTabs( $skin, &$links ) {
- TalkpageView::customizeTalkpageTabs( $skin, $links, $this );
-
- $links['history']['class'] = 'selected';
- }
-
function customizeNavigation( $skin, &$links ) {
TalkpageView::customizeTalkpageNavigation( $skin, $links, $this
);
$links['views']['history']['class'] = 'selected';
diff --git a/pages/TalkpageView.php b/pages/TalkpageView.php
index 003e3b2..a0fe8ef 100644
--- a/pages/TalkpageView.php
+++ b/pages/TalkpageView.php
@@ -14,21 +14,6 @@
$this->talkpage = $tp;
}
- /* Added to SkinTemplateTabs hook in TalkpageView::show(). */
- static function customizeTalkpageTabs( $skintemplate,
&$content_actions, $view ) {
- // The arguments are passed in by reference.
- unset( $content_actions['edit'] );
- unset( $content_actions['viewsource'] );
- unset( $content_actions['delete'] );
-
- # Protection against non-SkinTemplate skins
- if ( isset( $content_actions['history'] ) ) {
- $thisTitle = $view->article->getTitle();
- $history_url = $thisTitle->getLocalURL(
'lqt_method=talkpage_history' );
- $content_actions['history']['href'] = $history_url;
- }
- }
-
static function customizeTalkpageNavigation( $skin, &$links, $view ) {
$remove = array( 'views/edit', 'views/viewsource',
'actions/delete' );
@@ -42,10 +27,6 @@
$history_url = $title->getLocalURL(
'lqt_method=talkpage_history' );
$links['views']['history']['href'] = $history_url;
}
- }
-
- function customizeTabs( $skintemplate, &$links ) {
- self::customizeTalkpageTabs( $skintemplate, $links, $this );
}
function customizeNavigation( $skintemplate, &$links ) {
diff --git a/pages/ThreadDiffView.php b/pages/ThreadDiffView.php
index 4906730..d8f827f 100644
--- a/pages/ThreadDiffView.php
+++ b/pages/ThreadDiffView.php
@@ -2,14 +2,6 @@
if ( !defined( 'MEDIAWIKI' ) ) die;
class ThreadDiffView extends LqtView {
- function customizeTabs( $skintemplate, &$content_actions ) {
- unset( $content_actions['edit'] );
- unset( $content_actions['viewsource'] );
- unset( $content_actions['talk'] );
-
- $content_actions['history']['class'] = 'selected';
- }
-
function customizeNavigation( $skin, &$links ) {
$remove = array( 'views/edit', 'views/viewsource' );
diff --git a/pages/ThreadHistoryListingView.php
b/pages/ThreadHistoryListingView.php
index 3a7d5ff..a3a5722 100644
--- a/pages/ThreadHistoryListingView.php
+++ b/pages/ThreadHistoryListingView.php
@@ -29,11 +29,6 @@
return false;
}
- function customizeTabs( $skin, &$links ) {
- parent::customizeTabs( $skin, $links );
- $links['history']['class'] = 'selected';
- }
-
function customizeNavigation( $skin, &$links ) {
parent::customizeNavigation( $skin, $links );
$links['views']['history']['class'] = 'selected';
diff --git a/pages/ThreadPermalinkView.php b/pages/ThreadPermalinkView.php
index f07c6ae..57f808a 100644
--- a/pages/ThreadPermalinkView.php
+++ b/pages/ThreadPermalinkView.php
@@ -3,53 +3,8 @@
class ThreadPermalinkView extends LqtView {
protected $thread;
- function customizeTabs( $skin, &$links ) {
- self::customizeThreadTabs( $skin, $links, $this );
- }
-
function customizeNavigation( $skin, &$links ) {
self::customizeThreadNavigation( $skin, $links, $this );
- }
-
- static function customizeThreadTabs( $skintemplate, &$content_actions,
$view ) {
- if ( !$view->thread ) {
- return true;
- }
-
- // Insert 'article' and 'discussion' tabs before the thread tab.
-
- $tabs = self::getCustomTabs( $view );
- $content_actions = $tabs + $content_actions;
-
- unset( $content_actions['edit'] );
- unset( $content_actions['viewsource'] );
- unset( $content_actions['talk'] );
-
- if ( ! $view->thread->title() ) {
- throw new MWException( "Thread " . $view->thread->id()
. " has null title" );
- }
-
- $subpage = $view->thread->title()->getPrefixedText();
-
- // Repoint move/delete/history tabs
- if ( array_key_exists( 'move', $content_actions ) &&
$view->thread ) {
- $content_actions['move']['href'] =
- SpecialPage::getTitleFor( 'MoveThread',
$subpage )->getLocalURL();
- }
-
- if ( array_key_exists( 'delete', $content_actions ) &&
$view->thread ) {
- $content_actions['delete']['href'] =
- $view->thread->title()->getLocalURL(
'action=delete' );
- }
-
- if ( array_key_exists( 'history', $content_actions ) ) {
- $content_actions['history']['href'] =
self::permalinkUrl( $view->thread, 'thread_history' );
- if ( $view->methodApplies( 'thread_history' ) ) {
- $content_actions['history']['class'] =
'selected';
- }
- }
-
- return true;
}
static function customizeThreadNavigation( $skin, &$links, $view ) {
@@ -102,8 +57,8 @@
}
}
- // Pre-generates the tabs to be included, for customizeTabs and
customizeNavigation
- // to insert in the appropriate place
+ // Pre-generates the tabs to be included, for customizeNavigation
+ // to insert in the appropriate place
static function getCustomTabs( $view ) {
$tabs = array();
diff --git a/pages/ThreadProtectionFormView.php
b/pages/ThreadProtectionFormView.php
index 10a71b7..c233af5 100644
--- a/pages/ThreadProtectionFormView.php
+++ b/pages/ThreadProtectionFormView.php
@@ -3,15 +3,6 @@
// Pass-through wrapper
class ThreadProtectionFormView extends LqtView {
- function customizeTabs( $skintemplate, &$content_actions ) {
- ThreadPermalinkView::customizeThreadTabs( $skintemplate,
$content_actions, $this );
-
- if ( array_key_exists( 'protect', $content_actions ) )
- $content_actions['protect']['class'] = 'selected';
- elseif ( array_key_exists( 'unprotect', $content_actions ) )
- $content_actions['unprotect']['class'] = 'selected';
- }
-
function customizeNavigation( $skintemplate, &$links ) {
ThreadPermalinkView::customizeThreadNavigation( $skintemplate,
$links, $this );
--
To view, visit https://gerrit.wikimedia.org/r/174920
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5848b49c7b73c08c4400e1db9e046bd7ed1707b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits