Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | function execute( $query ) { |
28 | | - global $wgOut, $wgRequest, $sfgScriptPath; |
| 28 | + global $wgOut, $wgRequest; |
29 | 29 | |
30 | 30 | $this->setHeaders(); |
31 | 31 | |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | // redirect to 'FormEdit' for this target page. |
44 | 44 | if ( isset( $queryparts[1] ) ) { |
45 | 45 | $target_name = $queryparts[1]; |
46 | | - self::doRedirect( $form_name, $target_name, $params ); |
| 46 | + $this->doRedirect( $form_name, $target_name, $params ); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // Get namespace from the URL, if it's there. |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | $wgOut->addHTML( htmlspecialchars( wfMsg( 'sf_formstart_badtitle', $page_name ) ) ); |
85 | 85 | return; |
86 | 86 | } else { |
87 | | - self::doRedirect( $form_name, $page_name, $params ); |
| 87 | + $this->doRedirect( $form_name, $page_name, $params ); |
88 | 88 | return; |
89 | 89 | } |
90 | 90 | } |
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | } |
47 | 47 | echo self::showInputTypeOptions( $inputType, $fieldFormText, $paramValues ); |
48 | 48 | } else { |
49 | | - self::doSpecialCreateForm(); |
| 49 | + $this->doSpecialCreateForm(); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | array( 'page_namespace' => NS_TEMPLATE, 'page_is_redirect' => 0 ), |
91 | 91 | array( 'ORDER BY' => 'page_title' ) ); |
92 | 92 | if ( $db->numRows( $res ) > 0 ) { |
93 | | - while ( $row = $db->fetchRow( $res ) ) { |
| 93 | + foreach ( $res as $row ) { |
94 | 94 | $template_name = str_replace( '_', ' ', $row[0] ); |
95 | 95 | $all_templates[] = $template_name; |
96 | 96 | } |
Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | static function printPage( $form_name, $embedded = false ) { |
36 | | - global $wgOut, $wgRequest, $wgScriptPath, $sfgScriptPath, $sfgFormPrinter, $wgParser; |
| 36 | + global $wgOut, $wgRequest, $sfgFormPrinter, $wgParser; |
37 | 37 | |
38 | 38 | // Get contents of form-definition page. |
39 | 39 | $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name ); |
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow.php |
— | — | @@ -744,7 +744,6 @@ |
745 | 745 | * @access private |
746 | 746 | */ |
747 | 747 | function saveTempUploadedFile( $saveName, $tempName ) { |
748 | | - global $wgOut; |
749 | 748 | $repo = RepoGroup::singleton()->getLocalRepo(); |
750 | 749 | $status = $repo->storeTemp( $saveName, $tempName ); |
751 | 750 | if ( !$status->isGood() ) { |
— | — | @@ -891,7 +890,7 @@ |
892 | 891 | function mainUploadWindowForm( $msg = '' ) { |
893 | 892 | global $wgOut, $wgUser, $wgContLang; |
894 | 893 | global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview; |
895 | | - global $wgRequest, $wgAllowCopyUploads; |
| 894 | + global $wgAllowCopyUploads; |
896 | 895 | global $wgStylePath, $wgStyleVersion; |
897 | 896 | |
898 | 897 | $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck; |
— | — | @@ -1047,7 +1046,6 @@ |
1048 | 1047 | ); |
1049 | 1048 | |
1050 | 1049 | if ( $licenseshtml != '' ) { |
1051 | | - global $wgStylePath; |
1052 | 1050 | $wgOut->addHTML( " |
1053 | 1051 | <td align='$align1'><label for='wpLicense'>$license</label></td> |
1054 | 1052 | <td align='$align2'> |
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | * Special page entry point |
122 | 122 | */ |
123 | 123 | public function execute( $par ) { |
124 | | - global $wgUser, $wgOut, $wgRequest; |
| 124 | + global $wgUser, $wgOut; |
125 | 125 | // Disable $wgOut - we'll print out the page manually, taking |
126 | 126 | // the body created by the form, plus the necessary Javascript |
127 | 127 | // files, and turning them into an HTML page. |
— | — | @@ -296,12 +296,8 @@ |
297 | 297 | * @param array $warnings |
298 | 298 | */ |
299 | 299 | protected function uploadWarning( $warnings ) { |
300 | | - global $wgUser; |
301 | | - |
302 | 300 | $sessionKey = $this->mUpload->stashSession(); |
303 | 301 | |
304 | | - $sk = $wgUser->getSkin(); |
305 | | - |
306 | 302 | $warningHtml = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" |
307 | 303 | . '<ul class="warning">'; |
308 | 304 | foreach ( $warnings as $warning => $args ) { |
— | — | @@ -582,7 +578,7 @@ |
583 | 579 | * consisting of one or more <li> elements if there is a warning. |
584 | 580 | */ |
585 | 581 | public static function getExistsWarning( $exists ) { |
586 | | - global $wgUser, $wgContLang; |
| 582 | + global $wgUser; |
587 | 583 | |
588 | 584 | if ( !$exists ) |
589 | 585 | return ''; |
— | — | @@ -711,8 +707,6 @@ |
712 | 708 | protected $mSourceIds; |
713 | 709 | |
714 | 710 | public function __construct( $options = array() ) { |
715 | | - global $wgLang; |
716 | | - |
717 | 711 | $this->mWatch = !empty( $options['watch'] ); |
718 | 712 | $this->mForReUpload = !empty( $options['forreupload'] ); |
719 | 713 | $this->mSessionKey = isset( $options['sessionkey'] ) |
— | — | @@ -928,8 +922,6 @@ |
929 | 923 | * @return array Descriptor array |
930 | 924 | */ |
931 | 925 | protected function getOptionsSection() { |
932 | | - global $wgOut; |
933 | | - |
934 | 926 | $descriptor = array( |
935 | 927 | 'Watchthis' => array( |
936 | 928 | 'type' => 'check', |
— | — | @@ -1031,9 +1023,6 @@ |
1032 | 1024 | global $wgEnableFirefogg, $wgEnableJS2system; |
1033 | 1025 | global $wgOut; |
1034 | 1026 | |
1035 | | - $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck; |
1036 | | - $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview; |
1037 | | - |
1038 | 1027 | $scriptVars = array( |
1039 | 1028 | 'wgAjaxUploadDestCheck' => $wgUseAjax && $wgAjaxUploadDestCheck, |
1040 | 1029 | 'wgAjaxLicensePreview' => $wgUseAjax && $wgAjaxLicensePreview, |
Index: trunk/extensions/SemanticForms/includes/SF_FormEditPage.php |
— | — | @@ -49,7 +49,6 @@ |
50 | 50 | } |
51 | 51 | |
52 | 52 | protected function showContentForm() { |
53 | | - global $sfgIP; |
54 | 53 | $target_title = $this->mArticle->getTitle(); |
55 | 54 | $target_name = SFUtils::titleString( $target_title ); |
56 | 55 | if ( $target_title->exists() ) { |
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -19,8 +19,6 @@ |
20 | 20 | var $mPageTitle; |
21 | 21 | |
22 | 22 | public function __construct() { |
23 | | - global $smwgContLang; |
24 | | - |
25 | 23 | // Initialize variables. |
26 | 24 | $this->mSemanticTypeHooks = array(); |
27 | 25 | $this->mInputTypeHooks = array(); |
— | — | @@ -574,7 +572,7 @@ |
575 | 573 | $existing_page_content = str_replace( $existing_template_text, '{{{insertionpoint}}}', $existing_page_content ); |
576 | 574 | } |
577 | 575 | } else { |
578 | | - $existing_page_content = self::strReplaceFirst( $existing_template_text, '', $existing_page_content ); |
| 576 | + $existing_page_content = $this->strReplaceFirst( $existing_template_text, '', $existing_page_content ); |
579 | 577 | } |
580 | 578 | // If this is not a multiple-instance template, and we've found |
581 | 579 | // a match in the source page, there's a good chance that this |
— | — | @@ -1284,7 +1282,7 @@ |
1285 | 1283 | // wikis before SF 2.0.9. |
1286 | 1284 | 'class' => "multipleTemplateInstance multipleTemplate" |
1287 | 1285 | ), |
1288 | | - self::multipleTemplateInstanceTableHTML( $section ) |
| 1286 | + $this->multipleTemplateInstanceTableHTML( $section ) |
1289 | 1287 | ) . "\n"; |
1290 | 1288 | |
1291 | 1289 | // this will cause the section to be re-parsed on the next go |
— | — | @@ -1297,7 +1295,7 @@ |
1298 | 1296 | 'class' => "multipleTemplateStarter", |
1299 | 1297 | 'style' => "display: none", |
1300 | 1298 | ), |
1301 | | - self::multipleTemplateInstanceTableHTML( $section ) |
| 1299 | + $this->multipleTemplateInstanceTableHTML( $section ) |
1302 | 1300 | ) . "\n"; |
1303 | 1301 | $form_text .= <<<END |
1304 | 1302 | </div><!-- multipleTemplateList --> |
— | — | @@ -1433,8 +1431,6 @@ |
1434 | 1432 | * Create the HTML and Javascript to display this field within a form |
1435 | 1433 | */ |
1436 | 1434 | function formFieldHTML( $form_field, $cur_value ) { |
1437 | | - global $smwgContLang; |
1438 | | - |
1439 | 1435 | // also get the actual field, with all the semantic information (type is |
1440 | 1436 | // SFTemplateField, instead of SFFormField) |
1441 | 1437 | $template_field = $form_field->template_field; |
Index: trunk/extensions/SemanticForms/includes/SF_AutoEditAjaxHandler.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | */ |
61 | 61 | private function storeSemanticData ( $prefillFromExisting = true ) { |
62 | 62 | |
63 | | - global $wgOut, $wgRequest, $wgUser, $wgParser, $wgTitle; |
| 63 | + global $wgOut, $wgRequest, $wgParser, $wgTitle; |
64 | 64 | |
65 | 65 | if ( !array_key_exists( 'ok text', $this -> mOptions ) ) { |
66 | 66 | $this -> mOptions[ 'ok text' ] = wfMsg( 'sf_autoedit_success' ); |
— | — | @@ -187,9 +187,6 @@ |
188 | 188 | } |
189 | 189 | |
190 | 190 | private function parseDataFromHTMLFrag ( &$data, $html, $formID ) { |
191 | | - |
192 | | - global $wgOut; |
193 | | - |
194 | 191 | $doc = new DOMDocument(); |
195 | 192 | @$doc -> loadHTML( |
196 | 193 | '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body>' |
— | — | @@ -297,9 +294,6 @@ |
298 | 295 | * @return <type> |
299 | 296 | */ |
300 | 297 | private function parseDataFromQueryString ( &$data, $queryString, $expand = false ) { |
301 | | - |
302 | | - global $wgParser, $wgOut; |
303 | | - |
304 | 298 | $params = explode( '&', $queryString ); |
305 | 299 | |
306 | 300 | foreach ( $params as $i => $param ) { |
— | — | @@ -326,9 +320,6 @@ |
327 | 321 | // Format: 1stLevelName[2ndLevel][3rdLevel][...], i.e. normal array notation |
328 | 322 | // $value: the value to insert |
329 | 323 | private function addToArray ( &$array, $key, $value ) { |
330 | | - |
331 | | - global $wgOut, $wgParser; |
332 | | - |
333 | 324 | $matches = array( ); |
334 | 325 | |
335 | 326 | if ( preg_match( '/^([^\[\]]*)\[([^\[\]]*)\](.*)/', $key, $matches ) ) { |
Index: trunk/extensions/SemanticForms/includes/SF_FormClasses.php |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | foreach ( $matches[1] as $i => $field_name ) { |
129 | 129 | if ( ! in_array( $field_name, $fieldNamesArray ) ) { |
130 | 130 | $propertyName = $matches[2][$i]; |
131 | | - self::handlePropertySettingInTemplate( $field_name, $propertyName, true, $templateFields, $templateText ); |
| 131 | + $this->handlePropertySettingInTemplate( $field_name, $propertyName, true, $templateFields, $templateText ); |
132 | 132 | $fieldNamesArray[] = $field_name; |
133 | 133 | } |
134 | 134 | } |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | $field_name = trim( $matches[2][$i] ); |
141 | 141 | if ( ! in_array( $field_name, $fieldNamesArray ) ) { |
142 | 142 | $propertyName = trim( $propertyName ); |
143 | | - self::handlePropertySettingInTemplate( $field_name, $propertyName, false, $templateFields, $templateText ); |
| 143 | + $this->handlePropertySettingInTemplate( $field_name, $propertyName, false, $templateFields, $templateText ); |
144 | 144 | $fieldNamesArray[] = $field_name; |
145 | 145 | } |
146 | 146 | } |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | $fieldName = trim( $matches2[2][$i] ); |
156 | 156 | if ( ! in_array( $fieldName, $fieldNamesArray ) ) { |
157 | 157 | $propertyName = trim( $propertyName ); |
158 | | - self::handlePropertySettingInTemplate( $fieldName, $propertyName, false, $templateFields, $templateText ); |
| 158 | + $this->handlePropertySettingInTemplate( $fieldName, $propertyName, false, $templateFields, $templateText ); |
159 | 159 | $fieldNamesArray[] = $fieldName; |
160 | 160 | } |
161 | 161 | } |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | $propertyName = trim( $keyAndVal[0] ); |
174 | 174 | $fieldName = trim( $keyAndVal[1] ); |
175 | 175 | if ( ! in_array( $fieldName, $fieldNamesArray ) ) { |
176 | | - self::handlePropertySettingInTemplate( $fieldName, $propertyName, false, $templateFields, $templateText ); |
| 176 | + $this->handlePropertySettingInTemplate( $fieldName, $propertyName, false, $templateFields, $templateText ); |
177 | 177 | $fieldNamesArray[] = $fieldName; |
178 | 178 | } |
179 | 179 | } |
Index: trunk/extensions/SemanticForms/includes/SF_AutocompleteAPI.php |
— | — | @@ -19,8 +19,6 @@ |
20 | 20 | } |
21 | 21 | |
22 | 22 | public function execute() { |
23 | | - global $wgContLang; |
24 | | - |
25 | 23 | $params = $this->extractRequestParams(); |
26 | 24 | $substr = $params['substr']; |
27 | 25 | $namespace = $params['namespace']; |
— | — | @@ -147,7 +145,7 @@ |
148 | 146 | $res = $db->select( $from_clause, "DISTINCT $value_field", |
149 | 147 | $conditions, __METHOD__, $sql_options ); |
150 | 148 | |
151 | | - while ( $row = $db->fetchRow( $res ) ) { |
| 149 | + foreach ( $res as $row ) { |
152 | 150 | if ( $substring != null ) { |
153 | 151 | $values[] = array( 'title' => str_replace( '_', ' ', $row[0] ) ); |
154 | 152 | } else { |
Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php |
— | — | @@ -130,8 +130,7 @@ |
131 | 131 | * special pages) |
132 | 132 | */ |
133 | 133 | static function displayForm( $action, $article ) { |
134 | | - global $wgOut; |
135 | | - global $sfgIP, $sfgUseFormEditPage; |
| 134 | + global $wgOut, $sfgUseFormEditPage; |
136 | 135 | |
137 | 136 | // return "true" if the call failed (meaning, pass on handling |
138 | 137 | // of the hook to others), and "false" otherwise |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | $res = $db->select( $db->tableName( 'categorylinks' ), |
94 | 94 | 'distinct cl_to', $conditions, __METHOD__ ); |
95 | 95 | if ( $db->numRows( $res ) > 0 ) { |
96 | | - while ( $row = $db->fetchRow( $res ) ) { |
| 96 | + foreach ( $res as $row ) { |
97 | 97 | $categories[] = $row[0]; |
98 | 98 | } |
99 | 99 | } |
— | — | @@ -127,8 +127,6 @@ |
128 | 128 | * Creates HTML linking to a wiki page |
129 | 129 | */ |
130 | 130 | static function linkText( $namespace, $name, $text = NULL ) { |
131 | | - global $wgContLang; |
132 | | - |
133 | 131 | $title = Title::makeTitleSafe( $namespace, $name ); |
134 | 132 | if ( $title === NULL ) { |
135 | 133 | return $name; // TODO maybe report an error here? |
— | — | @@ -316,7 +314,7 @@ |
317 | 315 | __METHOD__, |
318 | 316 | array( 'ORDER BY' => 'page_title' ) ); |
319 | 317 | $form_names = array(); |
320 | | - while ( $row = $dbr->fetchRow( $res ) ) { |
| 318 | + foreach ( $res as $row ) { |
321 | 319 | $form_names[] = str_replace( '_', ' ', $row[0] ); |
322 | 320 | } |
323 | 321 | $dbr->freeResult( $res ); |
— | — | @@ -486,7 +484,7 @@ |
487 | 485 | 'page_title', |
488 | 486 | $conditions, __METHOD__, |
489 | 487 | array( 'ORDER BY' => 'page_title' ) ); |
490 | | - while ( $row = $db->fetchRow( $res ) ) { |
| 488 | + foreach ( $res as $row ) { |
491 | 489 | $cur_value = str_replace( '_', ' ', $row[0] ); |
492 | 490 | if ( $substring == null ) { |
493 | 491 | $pages[] = $cur_value; |