// $this->ids = array_map( 'intval', $this->ids );
$this->ids = array_unique( array_filter( $this->ids ) );
- if ( $request->getVal( 'action' ) == 'historysubmit' ) {
+ if ( $request->getVal( 'action' ) == 'historysubmit' || $request->getVal( 'action' ) == 'revisiondelete' ) {
// For show/hide form submission from history page
// Since we are access through index.php?title=XXX&action=historysubmit
// getFullTitle() will contain the target title and not our title
$links = array();
$links[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'viewpagelogs' ),
+ $this->msg( 'viewpagelogs' )->escaped(),
array(),
array( 'page' => $this->targetObj->getPrefixedText() )
);
# Give a link to the page history
$links[] = Linker::linkKnown(
$this->targetObj,
- wfMsgHtml( 'pagehist' ),
+ $this->msg( 'pagehist' )->escaped(),
array(),
array( 'action' => 'history' )
);
$undelete = SpecialPage::getTitleFor( 'Undelete' );
$links[] = Linker::linkKnown(
$undelete,
- wfMsgHtml( 'deletedhist' ),
+ $this->msg( 'deletedhist' )->escaped(),
array(),
array( 'target' => $this->targetObj->getPrefixedDBkey() )
);
}
}
# Logs themselves don't have histories or archived revisions
- $this->getOutput()->addSubtitle( $this->getLang()->pipeList( $links ) );
+ $this->getOutput()->addSubtitle( $this->getLanguage()->pipeList( $links ) );
}
}
/**
* Get the condition used for fetching log snippets
+ * @return array
*/
protected function getLogQueryCond() {
$conds = array();
$this->getOutput()->addWikiMsg( 'revdelete-no-file' );
return;
}
- if( !$oimage->userCan( File::DELETED_FILE, $this->getUser() ) ) {
+ $user = $this->getUser();
+ if( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
if( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
$this->getOutput()->permissionRequired( 'suppressrevision' );
} else {
}
return;
}
- if ( !$this->getUser()->matchEditToken( $this->token, $archiveName ) ) {
+ if ( !$user->matchEditToken( $this->token, $archiveName ) ) {
+ $lang = $this->getLanguage();
$this->getOutput()->addWikiMsg( 'revdelete-show-file-confirm',
$this->targetObj->getText(),
- $this->getLang()->date( $oimage->getTimestamp() ),
- $this->getLang()->time( $oimage->getTimestamp() ) );
+ $lang->userDate( $oimage->getTimestamp(), $user ),
+ $lang->userTime( $oimage->getTimestamp(), $user ) );
$this->getOutput()->addHTML(
Xml::openElement( 'form', array(
'method' => 'POST',
'action' => $this->getTitle()->getLocalUrl(
- 'target=' . urlencode( $oimage->getName() ) .
+ 'target=' . urlencode( $this->targetObj->getPrefixedDBkey() ) .
'&file=' . urlencode( $archiveName ) .
- '&token=' . urlencode( $this->getUser()->getEditToken( $archiveName ) ) )
+ '&token=' . urlencode( $user->getEditToken( $archiveName ) ) )
)
) .
- Xml::submitButton( wfMsg( 'revdelete-show-file-submit' ) ) .
+ Xml::submitButton( $this->msg( 'revdelete-show-file-submit' )->text() ) .
'</form>'
);
return;
$key = $oimage->getStorageKey();
$path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
- StreamFile::stream( $path );
+ $repo->streamFile( $path );
}
/**
$UserAllowed = true;
if ( $this->typeName == 'logging' ) {
- $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLang()->formatNum( count($this->ids) ) );
+ $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count($this->ids) ) );
} else {
$this->getOutput()->addWikiMsg( 'revdelete-selected',
$this->targetObj->getPrefixedText(), count( $this->ids ) );
$out = Xml::openElement( 'form', array( 'method' => 'post',
'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ),
'id' => 'mw-revdel-form-revisions' ) ) .
- Xml::fieldset( wfMsg( 'revdelete-legend' ) ) .
+ Xml::fieldset( $this->msg( 'revdelete-legend' )->text() ) .
$this->buildCheckBoxes() .
Xml::openElement( 'table' ) .
"<tr>\n" .
'<td class="mw-label">' .
- Xml::label( wfMsg( 'revdelete-log' ), 'wpRevDeleteReasonList' ) .
+ Xml::label( $this->msg( 'revdelete-log' )->text(), 'wpRevDeleteReasonList' ) .
'</td>' .
'<td class="mw-input">' .
Xml::listDropDown( 'wpRevDeleteReasonList',
- wfMsgForContent( 'revdelete-reason-dropdown' ),
- wfMsgForContent( 'revdelete-reasonotherlist' ), '', 'wpReasonDropDown', 1
+ $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->text(),
+ $this->msg( 'revdelete-reasonotherlist' )->inContentLanguage()->text(),
+ '', 'wpReasonDropDown', 1
) .
'</td>' .
"</tr><tr>\n" .
'<td class="mw-label">' .
- Xml::label( wfMsg( 'revdelete-otherreason' ), 'wpReason' ) .
+ Xml::label( $this->msg( 'revdelete-otherreason' )->text(), 'wpReason' ) .
'</td>' .
'<td class="mw-input">' .
Xml::input( 'wpReason', 60, $this->otherReason, array( 'id' => 'wpReason', 'maxlength' => 100 ) ) .
"</tr><tr>\n" .
'<td></td>' .
'<td class="mw-submit">' .
- Xml::submitButton( wfMsgExt('revdelete-submit','parsemag',$numRevisions),
+ Xml::submitButton( $this->msg( 'revdelete-submit', $numRevisions )->text(),
array( 'name' => 'wpSubmit' ) ) .
'</td>' .
"</tr>\n" .
$title = Title::makeTitle( NS_MEDIAWIKI, 'revdelete-reason-dropdown' );
$link = Linker::link(
$title,
- wfMsgHtml( 'revdelete-edit-reasonlist' ),
+ $this->msg( 'revdelete-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )
);
}
foreach( $this->checks as $item ) {
list( $message, $name, $field ) = $item;
- $innerHTML = Xml::checkLabel( wfMsg($message), $name, $name, $bitfield & $field );
+ $innerHTML = Xml::checkLabel( $this->msg( $message )->text(), $name, $name, $bitfield & $field );
if( $field == Revision::DELETED_RESTRICTED )
$innerHTML = "<b>$innerHTML</b>";
$line = Xml::tags( 'td', array( 'class' => 'mw-input' ), $innerHTML );
// Otherwise, use tri-state radios
} else {
$html .= '<tr>';
- $html .= '<th class="mw-revdel-checkbox">'.wfMsgHtml('revdelete-radio-same').'</th>';
- $html .= '<th class="mw-revdel-checkbox">'.wfMsgHtml('revdelete-radio-unset').'</th>';
- $html .= '<th class="mw-revdel-checkbox">'.wfMsgHtml('revdelete-radio-set').'</th>';
+ $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-same' )->escaped() . '</th>';
+ $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-unset' )->escaped() . '</th>';
+ $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-set' )->escaped() . '</th>';
$html .= "<th></th></tr>\n";
foreach( $this->checks as $item ) {
list( $message, $name, $field ) = $item;
$line = '<td class="mw-revdel-checkbox">' . Xml::radio( $name, -1, $selected == -1 ) . '</td>';
$line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 0, $selected == 0 ) . '</td>';
$line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 1, $selected == 1 ) . '</td>';
- $label = wfMsgHtml($message);
+ $label = $this->msg( $message )->escaped();
if( $field == Revision::DELETED_RESTRICTED ) {
$label = "<b>$label</b>";
}
/**
* UI entry point for form submission.
+ * @return bool
*/
protected function submit() {
# Check edit token on submission
$comment = $listReason;
if( $comment != 'other' && $this->otherReason != '' ) {
// Entry from drop down menu + additional comment
- $comment .= wfMsgForContent( 'colon-separator' ) . $this->otherReason;
+ $comment .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->otherReason;
} elseif( $comment == 'other' ) {
$comment = $this->otherReason;
}
/**
* Do the write operations. Simple wrapper for RevDel_*List::setVisibility().
+ * @return
*/
protected function save( $bitfield, $reason, $title ) {
return $this->getList()->setVisibility(