Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -944,11 +944,7 @@ |
945 | 945 | } |
946 | 946 | |
947 | 947 | function renderCollection( $collection, $referrer, $writer ) { |
948 | | - global $wgOut; |
949 | | - global $wgContLang; |
950 | | - global $wgServer; |
951 | | - global $wgScriptPath; |
952 | | - global $wgScriptExtension; |
| 948 | + global $wgOut, $wgContLang, $wgScriptPath, $wgScriptExtension; |
953 | 949 | |
954 | 950 | if ( !$writer ) { |
955 | 951 | $writer = 'rl'; |
— | — | @@ -956,7 +952,7 @@ |
957 | 953 | |
958 | 954 | $response = self::mwServeCommand( 'render', array( |
959 | 955 | 'metabook' => $this->buildJSONCollection( $collection ), |
960 | | - 'base_url' => $wgServer . $wgScriptPath, |
| 956 | + 'base_url' => wfExpandUrl( $wgScriptPath ), |
961 | 957 | 'script_extension' => $wgScriptExtension, |
962 | 958 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
963 | 959 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -982,19 +978,14 @@ |
983 | 979 | } |
984 | 980 | |
985 | 981 | function forceRenderCollection() { |
986 | | - global $wgOut; |
987 | | - global $wgContLang; |
988 | | - global $wgRequest; |
989 | | - global $wgServer; |
990 | | - global $wgScriptPath; |
991 | | - global $wgScriptExtension; |
| 982 | + global $wgOut, $wgContLang, $wgRequest, $wgScriptPath, $wgScriptExtension; |
992 | 983 | |
993 | 984 | $collectionID = $wgRequest->getVal( 'collection_id', '' ); |
994 | 985 | $writer = $wgRequest->getVal( 'writer', 'rl' ); |
995 | 986 | |
996 | 987 | $response = self::mwServeCommand( 'render', array( |
997 | 988 | 'collection_id' => $collectionID, |
998 | | - 'base_url' => $wgServer . $wgScriptPath, |
| 989 | + 'base_url' => wfExpandUrl( $wgScriptPath ), |
999 | 990 | 'script_extension' => $wgScriptExtension, |
1000 | 991 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
1001 | 992 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -1020,13 +1011,7 @@ |
1021 | 1012 | } |
1022 | 1013 | |
1023 | 1014 | function renderRenderingPage() { |
1024 | | - global $wgCollectionVersion; |
1025 | | - global $wgJsMimeType; |
1026 | | - global $wgLang; |
1027 | | - global $wgOut; |
1028 | | - global $wgRequest; |
1029 | | - global $wgScriptPath; |
1030 | | - global $wgServer; |
| 1015 | + global $wgCollectionVersion, $wgJsMimeType, $wgLang, $wgOut, $wgRequest, $wgScriptPath; |
1031 | 1016 | |
1032 | 1017 | $response = self::mwServeCommand( 'render_status', array( |
1033 | 1018 | 'collection_id' => $wgRequest->getVal( 'collection_id' ), |
— | — | @@ -1075,7 +1060,7 @@ |
1076 | 1061 | $wgOut->setPageTitle( wfMsg( 'coll-rendering_finished_title' ) ); |
1077 | 1062 | |
1078 | 1063 | $template = new CollectionFinishedTemplate(); |
1079 | | - $template->set( 'download_url', $wgServer . SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ) ); |
| 1064 | + $template->set( 'download_url', wfExpandUrl( SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ) ) ); |
1080 | 1065 | $template->set( 'is_cached', $wgRequest->getVal( 'is_cached' ) ); |
1081 | 1066 | $template->set( 'query', $query ); |
1082 | 1067 | $template->set( 'return_to', $return_to ); |
— | — | @@ -1156,10 +1141,7 @@ |
1157 | 1142 | } |
1158 | 1143 | |
1159 | 1144 | function postZIP( $collection, $partner ) { |
1160 | | - global $wgServer; |
1161 | | - global $wgScriptPath; |
1162 | | - global $wgScriptExtension; |
1163 | | - global $wgOut; |
| 1145 | + global $wgScriptPath, $wgScriptExtension, $wgOut; |
1164 | 1146 | |
1165 | 1147 | if ( !isset( $this->mPODPartners[$partner] ) ) { |
1166 | 1148 | $wgOut->showErrorPage( 'coll-invalid_podpartner_title', 'coll-invalid_podpartner_msg' ); |
— | — | @@ -1168,7 +1150,7 @@ |
1169 | 1151 | |
1170 | 1152 | $response = self::mwServeCommand( 'zip_post', array( |
1171 | 1153 | 'metabook' => $this->buildJSONCollection( $collection ), |
1172 | | - 'base_url' => $wgServer . $wgScriptPath, |
| 1154 | + 'base_url' => wfExpandUrl( $wgScriptPath ), |
1173 | 1155 | 'script_extension' => $wgScriptExtension, |
1174 | 1156 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
1175 | 1157 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
Index: trunk/extensions/Collection/Collection.templates.php |
— | — | @@ -444,11 +444,10 @@ |
445 | 445 | |
446 | 446 | // needed for Ajax functions |
447 | 447 | function getProposalList () { |
448 | | - global $wgServer; |
449 | | - global $wgScript; |
| 448 | + global $wgScript, $wgScriptPath; |
450 | 449 | |
451 | | - $mediapath = $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/'; |
452 | | - $baseUrl = $wgServer . $wgScript . "/"; |
| 450 | + $mediapath = $wgScriptPath . '/extensions/Collection/images/'; |
| 451 | + $baseUrl = $wgScript . "/"; |
453 | 452 | |
454 | 453 | $prop = $this->data['proposals']; |
455 | 454 | $out = ''; |