Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | * Helper function - returns a URL that includes Special:FormEdit. |
125 | 125 | */ |
126 | 126 | static function getFormEditURL( $formName, $targetName) { |
127 | | - $fe = SpecialPage::getPage( 'FormEdit' ); |
| 127 | + $fe = SFUtils::getSpecialPage( 'FormEdit' ); |
128 | 128 | // Special handling for forms whose name contains a slash. |
129 | 129 | if ( strpos( $formName, '/' ) !== false ) { |
130 | 130 | return $fe->getTitle()->getLocalURL( array( 'form' => $formName, 'target' => $targetName ) ); |
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | |
74 | 74 | static function printAltFormsList( $alt_forms, $target_name ) { |
75 | 75 | $text = ""; |
76 | | - $fe = SpecialPage::getPage( 'FormEdit' ); |
| 76 | + $fe = SFUtils::getSpecialPage( 'FormEdit' ); |
77 | 77 | $fe_url = $fe->getTitle()->getFullURL(); |
78 | 78 | $i = 0; |
79 | 79 | 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 = SpecialPage::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,8 @@ |
205 | 205 | return null; |
206 | 206 | } |
207 | 207 | |
208 | | - $fe = SpecialPage::getPage( 'FormEdit' ); |
| 208 | + $fe = SFUtils::getSpecialPage( 'FormEdit' ); |
| 209 | + |
209 | 210 | $fe_url = $fe->getTitle()->getLocalURL(); |
210 | 211 | if ( count( $default_forms ) > 0 ) { |
211 | 212 | $form_edit_url = $fe_url . "/" . $default_forms[0] . "/" . SFUtils::titleURLString( $target_page_title ); |
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -215,7 +215,7 @@ |
216 | 216 | } |
217 | 217 | } |
218 | 218 | |
219 | | - $ad = SpecialPage::getPage( 'FormEdit' ); |
| 219 | + $ad = SFUtils::getSpecialPage( 'FormEdit' ); |
220 | 220 | $link_url = $ad->getTitle()->getLocalURL() . "/$inFormName"; |
221 | 221 | if ( ! empty( $inTargetName ) ) { |
222 | 222 | $link_url .= "/$inTargetName"; |
— | — | @@ -332,7 +332,8 @@ |
333 | 333 | $inQueryStr = $param; |
334 | 334 | } |
335 | 335 | |
336 | | - $fs = SpecialPage::getPage( 'FormStart' ); |
| 336 | + $fs = SFUtils::getSpecialPage( 'FormStart' ); |
| 337 | + |
337 | 338 | $fs_url = $fs->getTitle()->getLocalURL(); |
338 | 339 | $str = <<<END |
339 | 340 | <form name="createbox" action="$fs_url" method="get" class="$classStr"> |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | public static function uploadableHTML( $input_id, $delimiter = null, $default_filename = null, $cur_value = '', $other_args = array() ) { |
47 | | - $upload_window_page = SpecialPage::getPage( 'UploadWindow' ); |
| 47 | + $upload_window_page = SFUtils::getSpecialPage( 'UploadWindow' ); |
48 | 48 | $query_string = "sfInputID=$input_id"; |
49 | 49 | if ( $delimiter != null ) { |
50 | 50 | $query_string .= "&sfDelimiter=$delimiter"; |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -836,4 +836,21 @@ |
837 | 837 | |
838 | 838 | return true; |
839 | 839 | } |
| 840 | + |
| 841 | + /** |
| 842 | + * Compatibility helper function. |
| 843 | + * Since 1.17 SpecialPageFactory::getPage should be used. |
| 844 | + * SpecialPage::getPage is deprecated in 1.18. |
| 845 | + * |
| 846 | + * @since 2.3.3 |
| 847 | + * |
| 848 | + * @param string $pageName |
| 849 | + * |
| 850 | + * @return SpecialPage|null |
| 851 | + */ |
| 852 | + public static function getSpecialPage( $pageName ) { |
| 853 | + $hasFactory = class_exists( 'SpecialPageFactory' ) && method_exists( 'SpecialPageFactory', 'getPage' ); |
| 854 | + return $hasFactory ? SpecialPageFactory::getPage( $pageName ) : SpecialPage::getPage( $pageName ); |
| 855 | + } |
| 856 | + |
840 | 857 | } |