/** * There's something wrong with this file, not enough to reject it * totally but we require manual intervention to save it for real. * Stash it away, then present a form asking to confirm or cancel. * * @param string $warning as HTML * @access private */ function uploadWarning($warning) { global $wgOut; global $wgUseCopyrightUpload; $this->mSessionKey = $this->stashSession(); if (!$this->mSessionKey) { # Couldn't save file; an error has been displayed so let's go. return; } $wgOut->addHTML("<h2>" . wfMsgHtml('uploadwarning') . "</h2>\n"); $wgOut->addHTML("<ul class='warning'>{$warning}</ul><br />\n"); $save = wfMsgHtml('savefile'); $reupload = wfMsgHtml('reupload'); $iw = wfMsgWikiHtml('ignorewarning'); $reup = wfMsgWikiHtml('reuploaddesc'); $titleObj = Title::makeTitle(NS_SPECIAL, 'Upload'); // WERELATE: added target and id $query = 'action=submit'; if ($this->mTarget) { $query .= '&target=' . urlencode($this->mTarget) . '&id=' . urlencode($this->mId); } $action = $titleObj->escapeLocalURL($query); if ($wgUseCopyrightUpload) { $copyright = "\n\t<input type='hidden' name='wpUploadCopyStatus' value=\"" . htmlspecialchars($this->mUploadCopyStatus) . "\" />\n\t<input type='hidden' name='wpUploadSource' value=\"" . htmlspecialchars($this->mUploadSource) . "\" />\n\t"; } else { $copyright = ""; } // WERELATE - added back-button instructions; added four fields; added id='wpUpload' to wpUpload button; removed reupload; added $people and $families; added checkboxes // metadata fields and tree checkboxes are ignored in a re-upload situation $people = $this->toForm($this->mPeople, 'person', NS_PERSON, false); $families = $this->toForm($this->mFamilies, 'family', NS_FAMILY, false); //!!! remove this code dependency before sharing require_once "extensions/familytree/FamilyTreeUtil.php"; global $wgUser, $wgRequest; $allTrees = FamilyTreeUtil::getFamilyTrees($wgUser->getName()); $checkedTreeIds = FamilyTreeUtil::readTreeCheckboxes($allTrees, $wgRequest); $treecheckboxeshtml = FamilyTreeUtil::generateHiddenTreeCheckboxes($allTrees, $checkedTreeIds); $wgOut->addHTML("<p><b>Press the \"back button\" on your browser to choose a different file, or</b></p>"); $wgOut->addHTML("\n\t<form id='uploadwarning' method='post' enctype='multipart/form-data' action='{$action}'>\n\t\t<input type='hidden' name='wpIgnoreWarning' value='1' />\n\t\t<input type='hidden' name='wpSessionKey' value=\"" . htmlspecialchars($this->mSessionKey) . "\" />\n\t\t<input type='hidden' name='wpUploadDescription' value=\"" . htmlspecialchars($this->mUploadDescription) . "\" />\n\t\t<input type='hidden' name='wrDate' value=\"" . htmlspecialchars($this->mDate) . "\" />\n\t\t<input type='hidden' name='wrPlace' value=\"" . htmlspecialchars($this->mPlace) . "\" />\n\t\t{$people}\n\t\t{$families}\n\t\t{$treecheckboxeshtml}\n\t\t<input type='hidden' name='wrCopyright' value=\"" . htmlspecialchars($this->mCopyright) . "\" />\n\t\t<input type='hidden' name='wpLicense' value=\"" . htmlspecialchars($this->mLicense) . "\" />\n\t\t<input type='hidden' name='wpDestFile' value=\"" . htmlspecialchars($this->mDestFile) . "\" />\n\t\t<input type='hidden' name='wpWatchthis' value=\"" . htmlspecialchars(intval($this->mWatchthis)) . "\" />\n\t{$copyright}\n\t<table border='0'>\n\t\t<tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right'>\n\t\t\t\t\t<input tabindex='2' type='submit' id='wpUpload' name='wpUpload' value=\"{$save}\" />\n\t\t\t\t</td>\n\t\t\t\t<td align='left'>{$iw}</td>\n\t\t\t</tr>\n\t\t</tr>\n\t</table></form>\n"); }