r112344 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112343‎ | r112344 | r112345 >
Date:19:51, 24 February 2012
Author:yaron
Status:reverted (Comments)
Tags:
Comment:
Follow-up to r112224 - removed now-unnecessary helper function SFUtils::getSpecialPage(), replaced with the function it called, SpecialPageFactory::getPage()
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Form.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormLinker.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_FormEdit.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -121,7 +121,7 @@
122122 * Helper function - returns a URL that includes Special:FormEdit.
123123 */
124124 static function getFormEditURL( $formName, $targetName) {
125 - $fe = SFUtils::getSpecialPage( 'FormEdit' );
 125+ $fe = SpecialPageFactory::getPage( 'FormEdit' );
126126 // Special handling for forms whose name contains a slash.
127127 if ( strpos( $formName, '/' ) !== false ) {
128128 return $fe->getTitle()->getLocalURL( array( 'form' => $formName, 'target' => $targetName ) );
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
@@ -71,7 +71,7 @@
7272
7373 static function printAltFormsList( $alt_forms, $target_name ) {
7474 $text = "";
75 - $fe = SFUtils::getSpecialPage( 'FormEdit' );
 75+ $fe = SpecialPageFactory::getPage( 'FormEdit' );
7676 $fe_url = $fe->getTitle()->getFullURL();
7777 $i = 0;
7878 foreach ( $alt_forms as $alt_form ) {
Index: trunk/extensions/SemanticForms/includes/SF_Form.php
@@ -52,7 +52,7 @@
5353
5454 function createMarkup() {
5555 $title = Title::makeTitle( SF_NS_FORM, $this->mFormName );
56 - $fs = SFUtils::getSpecialPage( 'FormStart' );
 56+ $fs = SpecialPageFactory::getPage( 'FormStart' );
5757 $form_start_url = SFUtils::titleURLString( $fs->getTitle() ) . "/" . $title->getPartialURL();
5858 $form_description = wfMsgForContent( 'sf_form_docu', $this->mFormName, $form_start_url );
5959 $form_input = "{{#forminput:form=" . $this->mFormName;
Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php
@@ -204,7 +204,7 @@
205205 return null;
206206 }
207207
208 - $fe = SFUtils::getSpecialPage( 'FormEdit' );
 208+ $fe = SpecialPageFactory::getPage( 'FormEdit' );
209209
210210 $fe_url = $fe->getTitle()->getLocalURL();
211211 if ( count( $default_forms ) > 0 ) {
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -273,7 +273,7 @@
274274 }
275275 }
276276
277 - $fs = SFUtils::getSpecialPage( 'FormStart' );
 277+ $fs = SpecialPageFactory::getPage( 'FormStart' );
278278
279279 $fs_url = $fs->getTitle()->getLocalURL();
280280 $str = <<<END
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php
@@ -94,7 +94,7 @@
9595 }
9696
9797 public static function uploadableHTML( $input_id, $delimiter = null, $default_filename = null, $cur_value = '', $other_args = array() ) {
98 - $upload_window_page = SFUtils::getSpecialPage( 'UploadWindow' );
 98+ $upload_window_page = SpecialPageFactory::getPage( 'UploadWindow' );
9999 $query_string = "sfInputID=$input_id";
100100 if ( $delimiter != null ) {
101101 $query_string .= "&sfDelimiter=$delimiter";
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -543,7 +543,6 @@
544544 * type, for use by both Javascript autocompletion and comboboxes.
545545 */
546546 public static function getAutocompleteValues( $source_name, $source_type ) {
547 -
548547 if ( $source_name == null ) {
549548 return null;
550549 }
@@ -718,19 +717,6 @@
719718 }
720719
721720 /**
722 - * Pre-1.17 compatibility helper function, now probably unnecessary.
723 - *
724 - * @since 2.3.3
725 - *
726 - * @param string $pageName
727 - *
728 - * @return SpecialPage|null
729 - */
730 - public static function getSpecialPage( $pageName ) {
731 - return SpecialPageFactory::getPage( $pageName );
732 - }
733 -
734 - /**
735721 * Returns a SQL condition for autocompletion substring value in a column.
736722 * @param string $value_column Value column name
737723 * @param string $substring Substring to look for
@@ -874,7 +860,7 @@
875861 }
876862 }
877863
878 - $ad = SFUtils::getSpecialPage( $specialPageName );
 864+ $ad = SpecialPageFactory::getPage( $specialPageName );
879865 $link_url = $ad->getTitle()->getLocalURL() . "/$inFormName";
880866 if ( ! empty( $inTargetName ) ) {
881867 $link_url .= "/$inTargetName";

Follow-up revisions

RevisionCommit summaryAuthorDate
r112515revert r112344, part revert r112224: SpecialPageFactory does not exist until ...foxtrott21:00, 27 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112224Removing support for MediaWiki 1.16 - that included removing pre-ResourceLoad...yaron17:20, 23 February 2012

Comments

#Comment by F.trott (talk | contribs)   21:03, 27 February 2012

Reverted: SpecialPageFactory does not exist until MW 1.18

Status & tagging log