Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | * Helper function - returns a URL that includes Special:FormEdit. |
123 | 123 | */ |
124 | 124 | static function getFormEditURL( $formName, $targetName) { |
125 | | - $fe = SpecialPageFactory::getPage( 'FormEdit' ); |
| 125 | + $fe = SFUtils::getSpecialPage( 'FormEdit' ); |
126 | 126 | // Special handling for forms whose name contains a slash. |
127 | 127 | if ( strpos( $formName, '/' ) !== false ) { |
128 | 128 | return $fe->getTitle()->getLocalURL( array( 'form' => $formName, 'target' => $targetName ) ); |
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | static function printAltFormsList( $alt_forms, $target_name ) { |
74 | 74 | $text = ""; |
75 | | - $fe = SpecialPageFactory::getPage( 'FormEdit' ); |
| 75 | + $fe = SFUtils::getSpecialPage( 'FormEdit' ); |
76 | 76 | $fe_url = $fe->getTitle()->getFullURL(); |
77 | 77 | $i = 0; |
78 | 78 | foreach ( $alt_forms as $alt_form ) { |
Index: trunk/extensions/SemanticForms/includes/SF_Form.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | |
54 | 54 | function createMarkup() { |
55 | 55 | $title = Title::makeTitle( SF_NS_FORM, $this->mFormName ); |
56 | | - $fs = SpecialPageFactory::getPage( 'FormStart' ); |
| 56 | + $fs = SFUtils::getSpecialPage( 'FormStart' ); |
57 | 57 | $form_start_url = SFUtils::titleURLString( $fs->getTitle() ) . "/" . $title->getPartialURL(); |
58 | 58 | $form_description = wfMsgForContent( 'sf_form_docu', $this->mFormName, $form_start_url ); |
59 | 59 | $form_input = "{{#forminput:form=" . $this->mFormName; |
Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | return null; |
206 | 206 | } |
207 | 207 | |
208 | | - $fe = SpecialPageFactory::getPage( 'FormEdit' ); |
| 208 | + $fe = SFUtils::getSpecialPage( 'FormEdit' ); |
209 | 209 | |
210 | 210 | $fe_url = $fe->getTitle()->getLocalURL(); |
211 | 211 | if ( count( $default_forms ) > 0 ) { |
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | } |
275 | 275 | } |
276 | 276 | |
277 | | - $fs = SpecialPageFactory::getPage( 'FormStart' ); |
| 277 | + $fs = SFUtils::getSpecialPage( 'FormStart' ); |
278 | 278 | |
279 | 279 | $fs_url = $fs->getTitle()->getLocalURL(); |
280 | 280 | $str = <<<END |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | } |
96 | 96 | |
97 | 97 | public static function uploadableHTML( $input_id, $delimiter = null, $default_filename = null, $cur_value = '', $other_args = array() ) { |
98 | | - $upload_window_page = SpecialPageFactory::getPage( 'UploadWindow' ); |
| 98 | + $upload_window_page = SFUtils::getSpecialPage( 'UploadWindow' ); |
99 | 99 | $query_string = "sfInputID=$input_id"; |
100 | 100 | if ( $delimiter != null ) { |
101 | 101 | $query_string .= "&sfDelimiter=$delimiter"; |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -296,7 +296,7 @@ |
297 | 297 | $output = $wgOut; |
298 | 298 | } else { |
299 | 299 | $output = $parser->getOutput(); |
300 | | - self::addJavascriptFiles( $parser ); |
| 300 | + self::addJavascriptFiles( $parser ); |
301 | 301 | } |
302 | 302 | |
303 | 303 | $output->addModules( 'ext.semanticforms.main' ); |
— | — | @@ -306,7 +306,7 @@ |
307 | 307 | $output->addModules( 'ext.semanticforms.submit' ); |
308 | 308 | $output->addModules( 'ext.smw.tooltips' ); |
309 | 309 | $output->addModules( 'ext.smw.sorttable' ); |
310 | | - } |
| 310 | + } |
311 | 311 | |
312 | 312 | /** |
313 | 313 | * Returns an array of all form names on this wiki. |
— | — | @@ -719,6 +719,22 @@ |
720 | 720 | } |
721 | 721 | |
722 | 722 | /** |
| 723 | + * Compatibility helper function. |
| 724 | + * Since 1.18 SpecialPageFactory::getPage should be used. |
| 725 | + * SpecialPage::getPage is deprecated in 1.18. |
| 726 | + * |
| 727 | + * @since 2.3.3 |
| 728 | + * |
| 729 | + * @param string $pageName |
| 730 | + * |
| 731 | + * @return SpecialPage|null |
| 732 | + */ |
| 733 | + public static function getSpecialPage( $pageName ) { |
| 734 | + $hasFactory = class_exists( 'SpecialPageFactory' ) && method_exists( 'SpecialPageFactory', 'getPage' ); |
| 735 | + return $hasFactory ? SpecialPageFactory::getPage( $pageName ) : SpecialPage::getPage( $pageName ); |
| 736 | + } |
| 737 | + |
| 738 | + /** |
723 | 739 | * Returns a SQL condition for autocompletion substring value in a column. |
724 | 740 | * @param string $value_column Value column name |
725 | 741 | * @param string $substring Substring to look for |
— | — | @@ -862,7 +878,7 @@ |
863 | 879 | } |
864 | 880 | } |
865 | 881 | |
866 | | - $ad = SpecialPageFactory::getPage( $specialPageName ); |
| 882 | + $ad = SFUtils::getSpecialPage( $specialPageName ); |
867 | 883 | $link_url = $ad->getTitle()->getLocalURL() . "/$inFormName"; |
868 | 884 | if ( ! empty( $inTargetName ) ) { |
869 | 885 | $link_url .= "/$inTargetName"; |
— | — | @@ -909,7 +925,7 @@ |
910 | 926 | } |
911 | 927 | |
912 | 928 | static function loadScriptsForPopupForm( &$parser ) { |
913 | | - $parser->getOutput()->addModules( 'ext.semanticforms.popupformedit' ); |
| 929 | + $parser->getOutput()->addModules( 'ext.semanticforms.popupformedit' ); |
914 | 930 | return true; |
915 | 931 | } |
916 | 932 | |