Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -911,7 +911,7 @@ |
912 | 912 | * @access private |
913 | 913 | */ |
914 | 914 | function mainUploadForm( $msg='' ) { |
915 | | - global $wgOut, $wgUser, $wgContLang; |
| 915 | + global $wgOut, $wgUser; |
916 | 916 | global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview; |
917 | 917 | global $wgRequest, $wgAllowCopyUploads; |
918 | 918 | global $wgStylePath, $wgStyleVersion; |
— | — | @@ -979,25 +979,25 @@ |
980 | 980 | # MIME type here, it's incomprehensible to most people and too long. |
981 | 981 | global $wgCheckFileExtensions, $wgStrictFileExtensions, |
982 | 982 | $wgFileExtensions, $wgFileBlacklist; |
| 983 | + |
| 984 | + $allowedExtensions = ''; |
983 | 985 | if( $wgCheckFileExtensions ) { |
984 | 986 | $delim = wfMsgExt( 'comma-separator', array( 'escapenoentities' ) ); |
985 | 987 | if( $wgStrictFileExtensions ) { |
986 | 988 | # Everything not permitted is banned |
987 | | - $wgOut->addHTML( |
| 989 | + $extensionsList = |
988 | 990 | '<div id="mw-upload-permitted">' . |
989 | 991 | wfMsgWikiHtml( 'upload-permitted', implode( $wgFileExtensions, $delim ) ) . |
990 | | - "</div>\n" |
991 | | - ); |
| 992 | + "</div>\n"; |
992 | 993 | } else { |
993 | 994 | # We have to list both preferred and prohibited |
994 | | - $wgOut->addHTML( |
| 995 | + $extensionsList = |
995 | 996 | '<div id="mw-upload-preferred">' . |
996 | 997 | wfMsgWikiHtml( 'upload-preferred', implode( $wgFileExtensions, $delim ) ) . |
997 | 998 | "</div>\n" . |
998 | 999 | '<div id="mw-upload-prohibited">' . |
999 | 1000 | wfMsgWikiHtml( 'upload-prohibited', implode( $wgFileBlacklist, $delim ) ) . |
1000 | | - "</div>\n" |
1001 | | - ); |
| 1001 | + "</div>\n"; |
1002 | 1002 | } |
1003 | 1003 | } |
1004 | 1004 | |
— | — | @@ -1014,7 +1014,6 @@ |
1015 | 1015 | |
1016 | 1016 | |
1017 | 1017 | $titleObj = SpecialPage::getTitleFor( 'Upload' ); |
1018 | | - $action = $titleObj->escapeLocalURL(); |
1019 | 1018 | |
1020 | 1019 | $encDestName = htmlspecialchars( $this->mDesiredDestName ); |
1021 | 1020 | |
— | — | @@ -1060,57 +1059,73 @@ |
1061 | 1060 | } |
1062 | 1061 | |
1063 | 1062 | $encComment = htmlspecialchars( $this->mComment ); |
1064 | | - $align1 = $wgContLang->isRTL() ? 'left' : 'right'; |
1065 | | - $align2 = $wgContLang->isRTL() ? 'right' : 'left'; |
1066 | 1063 | |
1067 | | - $wgOut->addHTML( <<<EOT |
1068 | | - <form id='upload' method='post' enctype='multipart/form-data' action="$action"> |
1069 | | - <table border='0'> |
1070 | | - <tr> |
1071 | | - {$this->uploadFormTextTop} |
1072 | | - <td align='$align1' valign='top'><label for='wpUploadFile'>{$sourcefilename}</label></td> |
1073 | | - <td align='$align2'> |
1074 | | - {$filename_form} |
1075 | | - </td> |
1076 | | - </tr> |
1077 | | - <tr> |
1078 | | - <td align='$align1'><label for='wpDestFile'>{$destfilename}</label></td> |
1079 | | - <td align='$align2'> |
1080 | | - <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60' |
1081 | | - value="$encDestName" onchange='toggleFilenameFiller()' $destOnkeyup /> |
1082 | | - </td> |
1083 | | - </tr> |
1084 | | - <tr> |
1085 | | - <td align='$align1'><label for='wpUploadDescription'>{$summary}</label></td> |
1086 | | - <td align='$align2'> |
1087 | | - <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' |
1088 | | - cols='{$cols}'{$width}>$encComment</textarea> |
| 1064 | + $wgOut->addHTML( |
| 1065 | + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL(), |
| 1066 | + 'enctype' => 'multipart/form-data', 'id' => 'mw-upload-form' ) ) . |
| 1067 | + Xml::openElement( 'fieldset' ) . |
| 1068 | + Xml::element( 'legend', null, wfMsg( 'upload' ) ) . |
| 1069 | + Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-upload-table' ) ) . |
| 1070 | + "<tr> |
| 1071 | + {$this->uploadFormTextTop} |
| 1072 | + <td class='mw-label'> |
| 1073 | + <label for='wpUploadFile'>{$sourcefilename}</label> |
| 1074 | + </td> |
| 1075 | + <td class='mw-input'> |
| 1076 | + {$filename_form} |
| 1077 | + </td> |
| 1078 | + </tr> |
| 1079 | + <tr> |
| 1080 | + <td></td> |
| 1081 | + <td> |
| 1082 | + {$extensionsList} |
| 1083 | + </td> |
| 1084 | + </tr> |
| 1085 | + <tr> |
| 1086 | + <td class='mw-label'> |
| 1087 | + <label for='wpDestFile'>{$destfilename}</label> |
| 1088 | + </td> |
| 1089 | + <td class='mw-input'> |
| 1090 | + <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60' |
| 1091 | + value=\"{$encDestName}\" onchange='toggleFilenameFiller()' $destOnkeyup /> |
| 1092 | + </td> |
| 1093 | + </tr> |
| 1094 | + <tr> |
| 1095 | + <td class='mw-label'> |
| 1096 | + <label for='wpUploadDescription'>{$summary}</label> |
| 1097 | + </td> |
| 1098 | + <td class='mw-input'> |
| 1099 | + <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' |
| 1100 | + cols='{$cols}'{$width}>$encComment</textarea> |
1089 | 1101 | {$this->uploadFormTextAfterSummary} |
1090 | | - </td> |
1091 | | - </tr> |
1092 | | - <tr> |
1093 | | -EOT |
| 1102 | + </td> |
| 1103 | + </tr> |
| 1104 | + <tr>" |
1094 | 1105 | ); |
1095 | 1106 | |
1096 | 1107 | if ( $licenseshtml != '' ) { |
1097 | 1108 | global $wgStylePath; |
1098 | 1109 | $wgOut->addHTML( " |
1099 | | - <td align='$align1'><label for='wpLicense'>$license</label></td> |
1100 | | - <td align='$align2'> |
1101 | | - <select name='wpLicense' id='wpLicense' tabindex='4' |
1102 | | - onchange='licenseSelectorCheck()'> |
1103 | | - <option value=''>$nolicense</option> |
1104 | | - $licenseshtml |
1105 | | - </select> |
1106 | | - </td> |
1107 | | - </tr> |
1108 | | - <tr>" ); |
| 1110 | + <td class='mw-label'> |
| 1111 | + <label for='wpLicense'>$license</label> |
| 1112 | + </td> |
| 1113 | + <td class='mw-input'> |
| 1114 | + <select name='wpLicense' id='wpLicense' tabindex='4' |
| 1115 | + onchange='licenseSelectorCheck()'> |
| 1116 | + <option value=''>$nolicense</option> |
| 1117 | + $licenseshtml |
| 1118 | + </select> |
| 1119 | + </td> |
| 1120 | + </tr> |
| 1121 | + <tr>" |
| 1122 | + ); |
1109 | 1123 | if( $useAjaxLicensePreview ) { |
1110 | 1124 | $wgOut->addHtml( " |
1111 | | - <td></td> |
1112 | | - <td id=\"mw-license-preview\"></td> |
1113 | | - </tr> |
1114 | | - <tr>" ); |
| 1125 | + <td></td> |
| 1126 | + <td id=\"mw-license-preview\"></td> |
| 1127 | + </tr> |
| 1128 | + <tr>" |
| 1129 | + ); |
1115 | 1130 | } |
1116 | 1131 | } |
1117 | 1132 | |
— | — | @@ -1121,45 +1136,55 @@ |
1122 | 1137 | $uploadsource = htmlspecialchars( $this->mCopyrightSource ); |
1123 | 1138 | |
1124 | 1139 | $wgOut->addHTML( " |
1125 | | - <td align='$align1' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus</label></td> |
1126 | | - <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' |
1127 | | - value=\"$copystatus\" size='60' /></td> |
| 1140 | + <td class='mw-label' style='white-space: nowrap;'> |
| 1141 | + <label for='wpUploadCopyStatus'>$filestatus</label></td> |
| 1142 | + <td class='mw-input'> |
| 1143 | + <input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' |
| 1144 | + value=\"$copystatus\" size='60' /> |
| 1145 | + </td> |
| 1146 | + </tr> |
| 1147 | + <tr> |
| 1148 | + <td class='mw-label'> |
| 1149 | + <label for='wpUploadCopyStatus'>$filesource</label> |
| 1150 | + </td> |
| 1151 | + <td class='mw-input'> |
| 1152 | + <input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' |
| 1153 | + value=\"$uploadsource\" size='60' /> |
| 1154 | + </td> |
| 1155 | + </tr> |
| 1156 | + <tr>" |
| 1157 | + ); |
| 1158 | + } |
| 1159 | + |
| 1160 | + $wgOut->addHtml( " |
| 1161 | + <td></td> |
| 1162 | + <td> |
| 1163 | + <input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' $watchChecked value='true' /> |
| 1164 | + <label for='wpWatchthis'>" . wfMsgHtml( 'watchthisupload' ) . "</label> |
| 1165 | + <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' $warningChecked/> |
| 1166 | + <label for='wpIgnoreWarning'>" . wfMsgHtml( 'ignorewarnings' ) . "</label> |
| 1167 | + </td> |
1128 | 1168 | </tr> |
| 1169 | + $warningRow |
1129 | 1170 | <tr> |
1130 | | - <td align='$align1'><label for='wpUploadCopyStatus'>$filesource</label></td> |
1131 | | - <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' |
1132 | | - value=\"$uploadsource\" size='60' /></td> |
| 1171 | + <td></td> |
| 1172 | + <td class='mw-input'> |
| 1173 | + <input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" . $wgUser->getSkin()->tooltipAndAccesskey( 'upload' ) . " /> |
| 1174 | + </td> |
1133 | 1175 | </tr> |
1134 | 1176 | <tr> |
1135 | | - "); |
1136 | | - } |
1137 | | - |
1138 | | - $wgOut->addHtml( " |
1139 | | - <td></td> |
1140 | | - <td> |
1141 | | - <input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' $watchChecked value='true' /> |
1142 | | - <label for='wpWatchthis'>" . wfMsgHtml( 'watchthisupload' ) . "</label> |
1143 | | - <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' $warningChecked/> |
1144 | | - <label for='wpIgnoreWarning'>" . wfMsgHtml( 'ignorewarnings' ) . "</label> |
1145 | | - </td> |
1146 | | - </tr> |
1147 | | - $warningRow |
1148 | | - <tr> |
1149 | | - <td></td> |
1150 | | - <td align='$align2'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" . $wgUser->getSkin()->tooltipAndAccesskey( 'upload' ) . " /></td> |
1151 | | - </tr> |
1152 | | - <tr> |
1153 | | - <td></td> |
1154 | | - <td align='$align2'> |
1155 | | - " ); |
| 1177 | + <td></td> |
| 1178 | + <td class='mw-input'>" |
| 1179 | + ); |
1156 | 1180 | $wgOut->addWikiText( wfMsgForContent( 'edittools' ) ); |
1157 | 1181 | $wgOut->addHTML( " |
1158 | | - </td> |
1159 | | - </tr> |
1160 | | - |
1161 | | - </table> |
1162 | | - <input type='hidden' name='wpDestFileWarningAck' id='wpDestFileWarningAck' value=''/> |
1163 | | - </form>" ); |
| 1182 | + </td> |
| 1183 | + </tr>" . |
| 1184 | + Xml::closeElement( 'table' ) . |
| 1185 | + Xml::hidden( 'wpDestFileWarningAck', '' ) . |
| 1186 | + Xml::closeElement( 'fieldset' ) . |
| 1187 | + Xml::closeElement( 'form' ) |
| 1188 | + ); |
1164 | 1189 | $uploadfooter = wfMsgNoTrans( 'uploadfooter' ); |
1165 | 1190 | if( $uploadfooter != '-' && !wfEmptyMsg( 'uploadfooter', $uploadfooter ) ){ |
1166 | 1191 | $wgOut->addWikiText( Xml::tags( 'div', |