| Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow.php |
| — | — | @@ -36,6 +36,7 @@ |
| 37 | 37 | function doSpecialUploadWindow() { |
| 38 | 38 | global $wgRequest, $wgOut, $wgUser, $wgServer; |
| 39 | 39 | global $wgScript, $wgJsMimeType, $wgStylePath, $wgStyleVersion; |
| | 40 | + global $wgContLang, $wgLanguageCode, $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces; |
| 40 | 41 | |
| 41 | 42 | // disable $wgOut - we'll print out the page manually, taking the |
| 42 | 43 | // body created by the form, plus the necessary Javascript files, |
| — | — | @@ -43,14 +44,28 @@ |
| 44 | 45 | $wgOut->disable(); |
| 45 | 46 | $form = new UploadWindowForm( $wgRequest ); |
| 46 | 47 | $form->execute(); |
| 47 | | - $user_js = "<script type=\"{$wgJsMimeType}\">" . $wgUser->getSkin()->getUserJs() . "; wgServer=\"{$wgServer}\"; wgScript=\"{$wgScript}\"</script>"; |
| | 48 | + $sk = $wgUser->getSkin(); |
| | 49 | + $sk->initPage($wgOut); // need to call this to set skin name correctly |
| | 50 | + $user_js = "<script type=\"{$wgJsMimeType}\">" . $sk->getUserJs() . "; wgServer=\"{$wgServer}\"; wgScript=\"{$wgScript}\"</script>"; |
| | 51 | + $vars_js = Skin::makeGlobalVariablesScript(array('skinname' => $sk->getSkinName())); |
| 48 | 52 | $wikibits_include = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js?$wgStyleVersion\"></script>"; |
| 49 | 53 | $ajax_include = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js?$wgStyleVersion\"></script>"; |
| 50 | 54 | $ajaxwatch_include = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxwatch.js?$wgStyleVersion\"></script>"; |
| 51 | 55 | $text = <<<END |
| 52 | | -<html> |
| | 56 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | 57 | +<html xmlns="{$wgXhtmlDefaultNamespace}" |
| | 58 | +END; |
| | 59 | + foreach($wgXhtmlNamespaces as $tag => $ns) { |
| | 60 | + $text .= "xmlns:{$tag}=\"{$ns}\" "; |
| | 61 | + } |
| | 62 | + $dir = $wgContLang->isRTL() ? "rtl" : "ltr"; |
| | 63 | + $text .= "xml:lang=\"{$wgLanguageCode}\" lang=\"{$wgLanguageCode}\" dir=\"{$dir}\">"; |
| | 64 | + |
| | 65 | + $text .= <<<END |
| | 66 | + |
| 53 | 67 | <head> |
| 54 | 68 | $user_js |
| | 69 | +$vars_js |
| 55 | 70 | $wikibits_include |
| 56 | 71 | $ajax_include |
| 57 | 72 | $ajaxwatch_include |
| — | — | @@ -66,7 +81,7 @@ |
| 67 | 82 | } |
| 68 | 83 | |
| 69 | 84 | /** |
| 70 | | - * implements Special:Upload |
| | 85 | + * implements Special:UploadWindow |
| 71 | 86 | * @addtogroup SpecialPage |
| 72 | 87 | */ |
| 73 | 88 | class UploadWindowForm { |