r80423 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80422‎ | r80423 | r80424 >
Date:20:34, 16 January 2011
Author:ialex
Status:deferred
Tags:
Comment:
Drop pre-1.11 and pre-1.14 compat code
Modified paths:
  • /trunk/extensions/DiscussionThreading/DiscussionThreading.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DiscussionThreading/DiscussionThreading.php
@@ -39,21 +39,11 @@
4040 $wgHooks['AlternateEdit'][] = 'efDiscussionThreadEdit';
4141 $wgHooks['DoEditSectionLink'][] = 'efDoDiscussionLink';
4242
43 -# must use the deprecated efDiscussionLink hook if before MW Version 1.14
44 -#
45 -if (version_compare( $wgVersion , '1.14.0' ) < 0 ) {
46 - $wgHooks['EditSectionLink'][] = 'efDiscussionLink';
47 -}
4843 /**
4944 * Initial setup, add .i18n. messages from $IP/extensions/DiscussionThreading/DiscussionThreading.i18n.php
5045 */
5146 function efDiscussionThreadSetup() {
52 - global $wgVersion;
53 - if (version_compare( $wgVersion , '1.11.0' ) < 0 ) {
54 - global $wgMessageCache, $messages;
55 - foreach( $messages as $lang => $LangMsg )
56 - $wgMessageCache->addMessages( $LangMsg, $lang );
57 - } else wfLoadExtensionMessages( 'DiscussionThreading' );
 47+ wfLoadExtensionMessages( 'DiscussionThreading' );
5848 }
5949
6050 /**
@@ -80,32 +70,6 @@
8171 return ( true );
8272 }
8373
84 -/**
85 - * This function creates a linkobject for the editSectionLink function in linker
86 - *
87 - * @param $callobj Article object.
88 - * @param $nt Title object.
89 - * @param $section Integer: section number.
90 - * @param $hint Link String: title, or default if omitted or empty
91 - * @param $url Link String: for edit url
92 - * @param $result String: Returns the section [new][edit][reply] html if in a talk page - otherwise whatever came in with
93 - * @return true
94 - */
95 -function efDiscussionLink ( $callobj , $nt , $section , $hint='' , $url , &$result )
96 -{
97 - global $wgSectionThreadingOn;
98 - if( $wgSectionThreadingOn && $nt->isTalkPage() ) {
99 - $commenturl = '&section='.$section.'&replyto=yes';
100 - $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'discussionthreading-replysectionhint', htmlspecialchars( $hint ) ) . '"';
101 - $curl = $callobj->makeKnownLinkObj( $nt, wfMsg( 'discussionthreading-replysection' ), 'action=edit'.$commenturl , '' , '' , '' , $hint );
102 - $newthreadurl = '&section=new';
103 - $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'discussionthreading-threadnewsectionhint', htmlspecialchars( $hint ) ) . '"';
104 - $nurl = $callobj->makeKnownLinkObj( $nt, wfMsg('discussionthreading-threadnewsection' ), 'action=edit'.$newthreadurl, '' , '' , '' , $hint );
105 - $result = $nurl."][".$url."][".$curl;
106 - }
107 - return ( true );
108 -}
109 -
11074 function efDoDiscussionLink ( $callobj , $nt , $section , $hint='' , $result , $lang = false )
11175 {
11276 global $wgSectionThreadingOn;

Status & tagging log