-
- # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only
- # See http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize for possible values of upload_max_filesize
- $val = wfShorthandToInteger( ini_get( 'upload_max_filesize' ) );
- $maxUploadSize = '<div id="mw-upload-maxfilesize">' .
- wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ),
- $wgLang->formatSize( $val ) ) .
- "</div>\n";
- //add a hidden filed for upload by url (uses the $wgMaxUploadSize var)
- if( UploadFromUrl::isEnabled() ) {
- $maxUploadSize.='<div id="mw-upload-maxfilesize-url" style="display:none">' .
- wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ),
- $wgLang->formatSize( $wgMaxUploadSize ) ) .
- "</div>\n";
- }
-
- $sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) );
- $destfilename = wfMsgExt( 'destfilename', array( 'parseinline', 'escapenoentities' ) );
-
- $msg = ( $this->mForReUpload ) ? 'filereuploadsummary' : 'fileuploadsummary';
- $summary = wfMsgExt( $msg, 'parseinline' );
-
- $licenses = new Licenses();
- $license = wfMsgExt( 'license', array( 'parseinline' ) );
- $nolicense = wfMsgHtml( 'nolicense' );
- $licenseshtml = $licenses->getHtml();
-
- $ulb = wfMsgHtml( 'uploadbtn' );
-
-
- $titleObj = SpecialPage::getTitleFor( 'Upload' );
-
- $encDestName = htmlspecialchars( $this->mDesiredDestName );
-
- $watchChecked = $this->watchCheck() ? 'checked="checked"' : '';
- # Re-uploads should not need "file exist already" warnings
- $warningChecked = ($this->mIgnoreWarning || $this->mForReUpload) ? 'checked="checked"' : '';
-
- // Prepare form for upload or upload/copy
- //javascript moved from inline calls to setup:
- if( UploadFromUrl::isEnabled() && $wgUser->isAllowed( 'upload_by_url' ) ) {
- if( $wgEnableJS2system ) {
- $filename_form =
- Xml::input( 'wpSourceType', false, 'file',
- array( 'id' => 'wpSourceTypeFile', 'type' => 'radio', 'checked' => 'checked' ) ) .
- Xml::input( 'wpUploadFile', 60, false,
- array( 'id' => 'wpUploadFile', 'type' => 'file', 'tabindex' => '1' ) ) .
- wfMsgHTML( 'upload_source_file' ) . "<br/>" .
- Xml::input( 'wpSourceType', false, 'Url',
- array( 'id' => 'wpSourceTypeURL', 'type' => 'radio' ) ) .
- Xml::input( 'wpUploadFileURL', 60, false,
- array( 'id' => 'wpUploadFileURL', 'type' => 'text', 'tabindex' => '1' ) ) .
- wfMsgHtml( 'upload_source_url' ) ;
- } else {
- //@@todo deprecate (not needed once $wgEnableJS2system is turned on)
- $filename_form =
- "<input type='radio' id='wpSourceTypeFile' name='wpSourceType' value='file' " .
- "onchange='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\")' checked='checked' />" .
- "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " .
- " onfocus='" .
- "toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\");" .
- "toggle_element_check(\"wpSourceTypeFile\",\"wpSourceTypeURL\")' " .
- "onchange='fillDestFilename(\"wpUploadFile\")' size='60' />" .
- wfMsgHTML( 'upload_source_file' ) . "<br/>" .
- "<input type='radio' id='wpSourceTypeURL' name='wpSourceType' value='Url' " .
- "onchange='toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\")' />" .
- "<input tabindex='1' type='text' name='wpUploadFileURL' id='wpUploadFileURL' " .
- "onfocus='" .
- "toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\");" .
- "toggle_element_check(\"wpSourceTypeURL\",\"wpSourceTypeFile\")' " .
- "onchange='fillDestFilename(\"wpUploadFileURL\")' size='60' />" .
- wfMsgHtml( 'upload_source_url' ) ;
-
- }
- } else {
- if( $wgEnableJS2system ) {
- $filename_form =
- Xml::input( 'wpUploadFile', 60, false,
- array( 'id' => 'wpUploadFile', 'type' => 'file', 'tabindex' => '1' ) ) .
- Xml::hidden( 'wpSourceType', 'file');
- } else {
- $filename_form =
- "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' size='60' ".
- "onchange='fillDestFilename(\"wpUploadFile\")' />" .
- "<input type='hidden' name='wpSourceType' value='file' />" ;
- }
- }
- $warningRow = '';
- $destOnkeyup = '';
- if( $wgEnableJS2system ) {
- $warningRow = "<tr><td colspan='2' id='wpDestFile-warning'> </td></tr>";
- } else {
- if ( $useAjaxDestCheck ) {
- $warningRow = "<tr><td colspan='2' id='wpDestFile-warning'> </td></tr>";
- $destOnkeyup = 'onchange=\'wgUploadWarningObj.checkNow(this.value);\'';
- }