# Better double-check that it hasn't been deleted yet!
$this->mPage->loadPageData( 'fromdbmaster' );
if ( !$this->mPage->exists() ) {
+ $deleteLogPage = new LogPage( 'delete' );
$outputPage = $this->getContext()->getOutput();
$outputPage->setPageTitle( wfMessage( 'cannotdelete-title', $title->getPrefixedText() ) );
$outputPage->wrapWikiMsg( "<div class=\"error mw-error-cannotdelete\">\n$1\n</div>",
array( 'cannotdelete', wfEscapeWikiText( $title->getPrefixedText() ) )
);
- $outputPage->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
+ $outputPage->addHTML(
+ Xml::element( 'h2', null, $deleteLogPage->getName()->text() )
+ );
LogEventsList::showLogExtract(
$outputPage,
'delete',
}
$outputPage->addHTML( $form );
- $outputPage->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
+
+ $deleteLogPage = new LogPage( 'delete' );
+ $outputPage->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $outputPage, 'delete',
$this->getTitle()
);
$outputPage->setPageTitle( wfMessage( 'cannotdelete-title', $this->getTitle()->getPrefixedText() ) );
if ( $error == '' ) {
$errors = $status->getErrorsArray();
+ $deleteLogPage = new LogPage( 'delete' );
$outputPage->wrapWikiMsg( "<div class=\"error mw-error-cannotdelete\">\n$1\n</div>",
$errors[0]
);
- $outputPage->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
+ $outputPage->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) );
LogEventsList::showLogExtract(
$outputPage,
$r .= ' '.$rcObj->timestamp.' </td><td>';
# Article or log link
if( $logType ) {
- $logtitle = SpecialPage::getTitleFor( 'Log', $logType );
- $logname = LogPage::logName( $logType );
- $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) )->escaped();
+ $logPage = new LogPage( $logType );
+ $logTitle = SpecialPage::getTitleFor( 'Log', $logType );
+ $logName = $logPage->getName()->escaped();
+ $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logTitle, $logName ) )->escaped();
} else {
$this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched );
}
*/
private function showLogEntries() {
global $wgOut;
- $wgOut->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+ $deleteLogPage = new LogPage( 'delete' );
+ $wgOut->addHTML( '<h2>' . $deleteLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $wgOut, 'delete', $this->title );
}
$this->disabledAttrib = $this->disabled
? array( 'disabled' => 'disabled' )
: array();
-
+
$this->loadData();
}
-
+
/**
* Loads the current state of protection into the object.
*/
function loadData() {
global $wgRequest, $wgUser;
global $wgRestrictionLevels;
-
+
$this->mCascade = $this->mTitle->areRestrictionsCascading();
$this->mReason = $wgRequest->getText( 'mwProtect-reason' );
foreach( $this->mApplicableTypes as $action ) {
// @todo FIXME: This form currently requires individual selections,
// but the db allows multiples separated by commas.
-
+
// Pull the actual restriction from the DB
$this->mRestrictions[$action] = implode( '', $this->mTitle->getRestrictions( $action ) );
* Get the expiry time for a given action, by combining the relevant inputs.
*
* @param $action string
- *
+ *
* @return string 14-char timestamp or "infinity", or false if the input was invalid
*/
function getExpiry( $action ) {
return wfMsg( 'protect-fallback', $permission );
}
}
-
+
function buildCleanupScript() {
global $wgRestrictionLevels, $wgGroupPermissions, $wgOut;
$cascadeableLevels = array();
foreach( $wgRestrictionLevels as $key ) {
if ( ( isset( $wgGroupPermissions[$key]['protect'] ) && $wgGroupPermissions[$key]['protect'] )
- || $key == 'protect'
+ || $key == 'protect'
) {
$cascadeableLevels[] = $key;
}
*/
function showLogExtract( &$out ) {
# Show relevant lines from the protection log:
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'protect' ) ) );
+ $protectLogPage = new LogPage( 'protect' );
+ $out->addHTML( Xml::element( 'h2', null, $protectLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $out, 'protect', $this->mTitle );
# Let extensions add other relevant log extracts
wfRunHooks( 'ProtectionForm::showLogExtract', array($this->mArticle,$out) );
public $flags;
- /**
- * @var Array
- */
- protected $message;
-
/**
* @var Array
*/
}
$this->flags = $flags;
- $this->preCacheMessages();
}
/**
return $this->getTitle();
}
- /**
- * As we use the same small set of messages in various methods and that
- * they are called often, we call them once and save them in $this->message
- */
- private function preCacheMessages() {
- // Precache various messages
- if( !isset( $this->message ) ) {
- $messages = array( 'revertmerge', 'protect_change', 'unblocklink', 'change-blocklink',
- 'revertmove', 'undeletelink', 'undeleteviewlink', 'revdel-restore', 'hist', 'diff',
- 'pipe-separator', 'revdel-restore-deleted', 'revdel-restore-visible' );
- foreach( $messages as $msg ) {
- $this->message[$msg] = $this->msg( $msg )->escaped();
- }
- }
- }
-
/**
* Set page title and show header for this log type
* @param $type Array
$formatter->setContext( $this->getContext() );
$formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) );
+ $title = $entry->getTarget();
+ $time = htmlspecialchars( $this->getLanguage()->userTimeAndDate(
+ $entry->getTimestamp(), $this->getUser() ) );
+
$action = $formatter->getActionText();
- $comment = $formatter->getComment();
- $classes = array( 'mw-logline-' . $entry->getType() );
- $title = $entry->getTarget();
- $time = $this->logTimestamp( $entry );
+ if ( $this->flags & self::NO_ACTION_LINK ) {
+ $revert = '';
+ } else {
+ $revert = $formatter->getActionLinks();
+ if ( $revert != '' ) {
+ $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
+ }
+ }
- // Extract extra parameters
- $paramArray = LogPage::extractParams( $row->log_params );
- // Add review/revert links and such...
- $revert = $this->logActionLinks( $row, $title, $paramArray, $comment );
+ $comment = $formatter->getComment();
// Some user can hide log items and have review links
$del = $this->getShowHideLinks( $row );
- if( $del != '' ) $del .= ' ';
// Any tags...
list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $row->ts_tags, 'logevent' );
- $classes = array_merge( $classes, $newClasses );
-
- return Xml::tags( 'li', array( "class" => implode( ' ', $classes ) ),
- $del . "$time $action $comment $revert $tagDisplay" ) . "\n";
- }
-
- private function logTimestamp( LogEntry $entry ) {
- return htmlspecialchars( $this->getLanguage()->userTimeAndDate(
- $entry->getTimestamp(), $this->getUser() ) );
- }
+ $classes = array_merge(
+ array( 'mw-logline-' . $entry->getType() ),
+ $newClasses
+ );
- /**
- * @todo split up!
- *
- * @param $row
- * @param Title $title
- * @param Array $paramArray
- * @param String $comment Passed by reference
- * @return String
- */
- private function logActionLinks( $row, $title, $paramArray, &$comment ) {
- if( ( $this->flags & self::NO_ACTION_LINK ) // we don't want to see the action
- || self::isDeleted( $row, LogPage::DELETED_ACTION ) ) // action is hidden
- {
- return '';
- }
- $revert = '';
- if( self::typeAction( $row, 'move', 'move', 'move' ) && !empty( $paramArray[0] ) ) {
- $destTitle = Title::newFromText( $paramArray[0] );
- if( $destTitle ) {
- $revert = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Movepage' ),
- $this->message['revertmove'],
- array(),
- array(
- 'wpOldTitle' => $destTitle->getPrefixedDBkey(),
- 'wpNewTitle' => $title->getPrefixedDBkey(),
- 'wpReason' => $this->msg( 'revertmove' )->inContentLanguage()->text(),
- 'wpMovetalk' => 0
- )
- );
- $revert = $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
- }
- // Show undelete link
- } elseif( self::typeAction( $row, array( 'delete', 'suppress' ), 'delete', 'deletedhistory' ) ) {
- if( !$this->getUser()->isAllowed( 'undelete' ) ) {
- $viewdeleted = $this->message['undeleteviewlink'];
- } else {
- $viewdeleted = $this->message['undeletelink'];
- }
- $revert = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Undelete' ),
- $viewdeleted,
- array(),
- array( 'target' => $title->getPrefixedDBkey() )
- );
- $revert = $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
- // Show unblock/change block link
- } elseif( self::typeAction( $row, array( 'block', 'suppress' ), array( 'block', 'reblock' ), 'block' ) ) {
- $revert = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Unblock', $row->log_title ),
- $this->message['unblocklink']
- ) .
- $this->message['pipe-separator'] .
- Linker::linkKnown(
- SpecialPage::getTitleFor( 'Block', $row->log_title ),
- $this->message['change-blocklink']
- );
- $revert = $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
- // Show change protection link
- } elseif( self::typeAction( $row, 'protect', array( 'modify', 'protect', 'unprotect' ) ) ) {
- $revert .= Linker::link( $title,
- $this->message['hist'],
- array(),
- array(
- 'action' => 'history',
- 'offset' => $row->log_timestamp
- )
- );
- if( $this->getUser()->isAllowed( 'protect' ) ) {
- $revert .= $this->message['pipe-separator'] .
- Linker::link( $title,
- $this->message['protect_change'],
- array(),
- array( 'action' => 'protect' ),
- 'known' );
- }
- $revert = ' ' . $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
- // Show unmerge link
- } elseif( self::typeAction( $row, 'merge', 'merge', 'mergehistory' ) ) {
- $revert = Linker::linkKnown(
- SpecialPage::getTitleFor( 'MergeHistory' ),
- $this->message['revertmerge'],
- array(),
- array(
- 'target' => $paramArray[0],
- 'dest' => $title->getPrefixedDBkey(),
- 'mergepoint' => $paramArray[1]
- )
- );
- $revert = $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
- // If an edit was hidden from a page give a review link to the history
- } elseif( self::typeAction( $row, array( 'delete', 'suppress' ), 'revision', 'deletedhistory' ) ) {
- $revert = RevisionDeleter::getLogLinks( $title, $paramArray,
- $this->message );
- // Hidden log items, give review link
- } elseif( self::typeAction( $row, array( 'delete', 'suppress' ), 'event', 'deletedhistory' ) ) {
- if( count($paramArray) >= 1 ) {
- $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
- // $paramArray[1] is a CSV of the IDs
- $query = $paramArray[0];
- // Link to each hidden object ID, $paramArray[1] is the url param
- $revert = Linker::linkKnown(
- $revdel,
- $this->message['revdel-restore'],
- array(),
- array(
- 'target' => $title->getPrefixedText(),
- 'type' => 'logging',
- 'ids' => $query
- )
- );
- $revert = $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
- }
- // Do nothing. The implementation is handled by the hook modifiying the passed-by-ref parameters.
- } else {
- wfRunHooks( 'LogLine', array( $row->log_type, $row->log_action, $title, $paramArray,
- &$comment, &$revert, $row->log_timestamp ) );
- }
- if( $revert != '' ) {
- $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
- }
- return $revert;
+ return Html::rawElement( 'li', array( 'class' => $classes ),
+ "$del $time $action $comment $revert $tagDisplay" ) . "\n";
}
/**
/**
* Set the visibility restrictions for displaying content.
- * If set to public, and an item is deleted, then it will be replaced
+ * If set to public, and an item is deleted, then it will be replaced
* with a placeholder even if the context user is allowed to view it.
* @param $audience integer self::FOR_THIS_USER or self::FOR_PUBLIC
*/
public function setAudience( $audience ) {
$this->audience = ( $audience == self::FOR_THIS_USER )
- ? self::FOR_THIS_USER
+ ? self::FOR_THIS_USER
: self::FOR_PUBLIC;
}
/**
* Check if a log item can be displayed
* @param $field integer LogPage::DELETED_* constant
- * @return bool
+ * @return bool
*/
protected function canView( $field ) {
if ( $this->audience == self::FOR_THIS_USER ) {
- return LogEventsList::userCanBitfield(
+ return LogEventsList::userCanBitfield(
$this->entry->getDeleted(), $field, $this->context->getUser() );
} else {
return !$this->entry->isDeleted( $field );
break;
}
break;
-
+
// case 'suppress' --private log -- aaron (sign your messages so we know who to blame in a few years :-D)
// default:
return "logentry-$type-$subtype";
}
+ /**
+ * Returns extra links that comes after the action text, like "revert", etc.
+ *
+ * @return string
+ */
+ public function getActionLinks() {
+ return '';
+ }
+
/**
* Extracts the optional extra parameters for use in action messages.
* The array indexes start from number 3.
* @since 1.19
*/
class LegacyLogFormatter extends LogFormatter {
+
+ /**
+ * Backward compatibility for extension changing the comment from
+ * the LogLine hook. This will be set by the first call on getComment(),
+ * then it might be modified by the hook when calling getActionLinks(),
+ * so that the modified value will be returned when calling getComment()
+ * a second time.
+ *
+ * @var string|null
+ */
+ private $comment = null;
+
+ /**
+ * Cache for the result of getActionLinks() so that it does not need to
+ * run multiple times depending on the order that getComment() and
+ * getActionLinks() are called.
+ *
+ * @var string|null
+ */
+ private $revert = null;
+
+ public function getComment() {
+ if ( $this->comment === null ) {
+ $this->comment = parent::getComment();
+ }
+
+ // Make sure we execute the LogLine hook so that we immediately return
+ // the correct value.
+ if ( $this->revert === null ) {
+ $this->getActionLinks();
+ }
+
+ return $this->comment;
+ }
+
protected function getActionMessage() {
$entry = $this->entry;
$action = LogPage::actionText(
return $action;
}
+ public function getActionLinks() {
+ if ( $this->revert !== null ) {
+ return $this->revert;
+ }
+
+ if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) ) {
+ return $this->revert = '';
+ }
+
+ $title = $this->entry->getTarget();
+ $type = $this->entry->getType();
+ $subtype = $this->entry->getSubtype();
+
+ // Show unblock/change block link
+ if ( ( $type == 'block' || $type == 'suppress' ) && ( $subtype == 'block' || $subtype == 'reblock' ) ) {
+ if ( !$this->context->getUser()->isAllowed( 'block' ) ) {
+ return '';
+ }
+
+ $links = array(
+ Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Unblock', $title->getDBkey() ),
+ $this->msg( 'unblocklink' )->escaped()
+ ),
+ Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Block', $title->getDBkey() ),
+ $this->msg( 'change-blocklink' )->escaped()
+ )
+ );
+ return $this->msg( 'parentheses' )->rawParams(
+ $this->context->getLanguage()->pipeList( $links ) )->escaped();
+ // Show change protection link
+ } elseif ( $type == 'protect' && ( $subtype == 'protect' || $subtype == 'modify' || $subtype == 'unprotect' ) ) {
+ $links = array(
+ Linker::link( $title,
+ $this->msg( 'hist' )->escaped(),
+ array(),
+ array(
+ 'action' => 'history',
+ 'offset' => $this->entry->getTimestamp()
+ )
+ )
+ );
+ if ( $this->context->getUser()->isAllowed( 'protect' ) ) {
+ $links[] = Linker::linkKnown(
+ $title,
+ $this->msg( 'protect_change' )->escaped(),
+ array(),
+ array( 'action' => 'protect' )
+ );
+ }
+ return $this->msg( 'parentheses' )->rawParams(
+ $this->context->getLanguage()->pipeList( $links ) )->escaped();
+ // Show unmerge link
+ } elseif( $type == 'merge' && $subtype == 'merge' ) {
+ if ( !$this->context->getUser()->isAllowed( 'mergehistory' ) ) {
+ return '';
+ }
+
+ $params = $this->extractParameters();
+ $revert = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'MergeHistory' ),
+ $this->msg( 'revertmerge' )->escaped(),
+ array(),
+ array(
+ 'target' => $params[3],
+ 'dest' => $title->getPrefixedDBkey(),
+ 'mergepoint' => $params[4]
+ )
+ );
+ return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
+ }
+
+ // Do nothing. The implementation is handled by the hook modifiying the
+ // passed-by-ref parameters. This also changes the default value so that
+ // getComment() and getActionLinks() do not call them indefinitely.
+ $this->revert = '';
+
+ // This is to populate the $comment member of this instance so that it
+ // can be modified when calling the hook just below.
+ if ( $this->comment === null ) {
+ $this->getComment();
+ }
+
+ $params = $this->entry->getParameters();
+
+ wfRunHooks( 'LogLine', array( $type, $subtype, $title, $params,
+ &$this->comment, &$this->revert, $this->entry->getTimestamp() ) );
+
+ return $this->revert;
+ }
}
/**
$params[3] = Message::rawParam( $newname );
return $params;
}
+
+ public function getActionLinks() {
+ if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
+ || $this->entry->getSubtype() !== 'move'
+ || !$this->context->getUser()->isAllowed( 'move' ) )
+ {
+ return '';
+ }
+
+ $params = $this->extractParameters();
+ $destTitle = Title::newFromText( $params[3] );
+ if ( !$destTitle ) {
+ return '';
+ }
+
+ $revert = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Movepage' ),
+ $this->msg( 'revertmove' )->escaped(),
+ array(),
+ array(
+ 'wpOldTitle' => $destTitle->getPrefixedDBkey(),
+ 'wpNewTitle' => $this->entry->getTarget()->getPrefixedDBkey(),
+ 'wpReason' => $this->msg( 'revertmove' )->inContentLanguage()->text(),
+ 'wpMovetalk' => 0
+ )
+ );
+ return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
+ }
}
/**
return (int) $string;
}
}
+
+ public function getActionLinks() {
+ $user = $this->context->getUser();
+ if ( !$user->isAllowed( 'deletedhistory' ) || $this->entry->isDeleted( LogPage::DELETED_ACTION ) ) {
+ return '';
+ }
+
+ switch ( $this->entry->getSubtype() ) {
+ case 'delete': // Show undelete link
+ if( $user->isAllowed( 'undelete' ) ) {
+ $message = 'undeletelink';
+ } else {
+ $message = 'undeleteviewlink';
+ }
+ $revert = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Undelete' ),
+ $this->msg( $message )->escaped(),
+ array(),
+ array( 'target' => $this->entry->getTarget()->getPrefixedDBkey() )
+ );
+ return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
+
+ case 'revision': // If an edit was hidden from a page give a review link to the history
+ $params = $this->extractParameters();
+ if ( !isset( $params[3] ) || !isset( $params[4] ) ) {
+ return '';
+ }
+
+ // Different revision types use different URL params...
+ $key = $params[3];
+ // This is a CSV of the IDs
+ $ids = explode( ',', $params[4] );
+
+ $links = array();
+
+ // If there's only one item, we can show a diff link
+ if ( count( $ids ) == 1 ) {
+ // Live revision diffs...
+ if ( $key == 'oldid' || $key == 'revision' ) {
+ $links[] = Linker::linkKnown(
+ $this->entry->getTarget(),
+ $this->msg( 'diff' )->escaped(),
+ array(),
+ array(
+ 'diff' => intval( $ids[0] ),
+ 'unhide' => 1
+ )
+ );
+ // Deleted revision diffs...
+ } elseif ( $key == 'artimestamp' || $key == 'archive' ) {
+ $links[] = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Undelete' ),
+ $this->msg( 'diff' )->escaped(),
+ array(),
+ array(
+ 'target' => $this->entry->getTarget()->getPrefixedDBKey(),
+ 'diff' => 'prev',
+ 'timestamp' => $ids[0]
+ )
+ );
+ }
+ }
+
+ // View/modify link...
+ $links[] = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Revisiondelete' ),
+ $this->msg( 'revdel-restore' )->escaped(),
+ array(),
+ array(
+ 'target' => $this->entry->getTarget()->getPrefixedText(),
+ 'type' => $key,
+ 'ids' => implode( ',', $ids ),
+ )
+ );
+
+ return $this->msg( 'parentheses' )->rawParams(
+ $this->context->getLanguage()->pipeList( $links ) )->escaped();
+
+ case 'event': // Hidden log items, give review link
+ $params = $this->extractParameters();
+ if ( !isset( $params[3] ) ) {
+ return '';
+ }
+ // This is a CSV of the IDs
+ $query = $params[3];
+ // Link to each hidden object ID, $params[1] is the url param
+ $revert = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Revisiondelete' ),
+ $this->msg( 'revdel-restore' )->escaped(),
+ array(),
+ array(
+ 'target' => $this->entry->getTarget()->getPrefixedText(),
+ 'type' => 'logging',
+ 'ids' => $query
+ )
+ );
+ return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
+ default:
+ return '';
+ }
+ }
}
/**
# Use the language name for log titles, rather than Log/X
if( $name == 'Log' ) {
- $titleLink = Linker::link( $title, LogPage::logName( $par ) );
- $titleLink = wfMessage( 'parentheses' )->inLanguage( $lang )
- ->rawParams( $titleLink )->escaped();
+ $logPage = new LogPage( $par );
+ $titleLink = Linker::link( $title, $logPage->getName()->escaped() );
+ $titleLink = wfMessage( 'parentheses' )
+ ->inLanguage( $lang )
+ ->rawParams( $titleLink )
+ ->escaped();
} else {
$titleLink = Linker::link( $title );
}
return $timestamp;
}
-
- /**
- * Creates utility links for log entries.
- *
- * @param $title Title
- * @param $paramArray Array
- * @param $messages
- * @return String
- */
- public static function getLogLinks( $title, $paramArray, $messages ) {
- global $wgLang;
-
- if ( count( $paramArray ) >= 2 ) {
- // Different revision types use different URL params...
- $key = $paramArray[0];
- // $paramArray[1] is a CSV of the IDs
- $Ids = explode( ',', $paramArray[1] );
-
- $revert = array();
-
- // Diff link for single rev deletions
- if ( count( $Ids ) == 1 ) {
- // Live revision diffs...
- if ( in_array( $key, array( 'oldid', 'revision' ) ) ) {
- $revert[] = Linker::linkKnown(
- $title,
- $messages['diff'],
- array(),
- array(
- 'diff' => intval( $Ids[0] ),
- 'unhide' => 1
- )
- );
- // Deleted revision diffs...
- } elseif ( in_array( $key, array( 'artimestamp','archive' ) ) ) {
- $revert[] = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Undelete' ),
- $messages['diff'],
- array(),
- array(
- 'target' => $title->getPrefixedDBKey(),
- 'diff' => 'prev',
- 'timestamp' => $Ids[0]
- )
- );
- }
- }
-
- // View/modify link...
- $revert[] = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Revisiondelete' ),
- $messages['revdel-restore'],
- array(),
- array(
- 'target' => $title->getPrefixedText(),
- 'type' => $key,
- 'ids' => implode(',', $Ids),
- )
- );
-
- // Pipe links
- return wfMsg( 'parentheses', $wgLang->pipeList( $revert ) );
- }
- return '';
- }
}
$out->addWikiMsg( 'mergehistory-empty' );
}
- # Show relevant lines from the deletion log:
- $out->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'merge' ) ) . "</h2>\n" );
+ # Show relevant lines from the merge log:
+ $mergeLogPage = new LogPage( 'merge' );
+ $out->addHTML( '<h2>' . $mergeLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $out, 'merge', $this->mTargetObj );
# When we submit, go by page ID to avoid some nasty but unlikely collisions.
}
function showLogFragment( $title ) {
+ $moveLogPage = new LogPage( 'move' );
$out = $this->getOutput();
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'move' ) ) );
+ $out->addHTML( Xml::element( 'h2', null, $moveLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $out, 'move', $title );
}
$qc = $this->getLogQueryCond();
# Show relevant lines from the deletion log
- $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+ $deleteLogPage = new LogPage( 'delete' );
+ $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $output, 'delete',
$this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
# Show relevant lines from the suppression log
if( $user->isAllowed( 'suppressionlog' ) ) {
- $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
+ $suppressLogPage = new LogPage( 'suppress' );
+ $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $output, 'suppress',
$this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
}
}
# Show relevant lines from the deletion log:
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) . "\n" );
+ $deleteLogPage = new LogPage( 'delete' );
+ $out->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) . "\n" );
LogEventsList::showLogExtract( $out, 'delete', $this->mTargetObj );
# Show relevant lines from the suppression log:
+ $suppressLogPage = new LogPage( 'suppress' );
if( $this->getUser()->isAllowed( 'suppressionlog' ) ) {
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'suppress' ) ) . "\n" );
+ $out->addHTML( Xml::element( 'h2', null, $suppressLogPage->getName()->text() ) . "\n" );
LogEventsList::showLogExtract( $out, 'suppress', $this->mTargetObj );
}
if( $this->mType == 'signup' ) {
$attr['type'] = 'signup';
}
- if( $this->mReturnTo ) {
+ if( $this->mReturnTo !== '' ) {
$attr['returnto'] = $this->mReturnTo;
+ $attr['returntoquery'] = $this->mReturnToQuery;
}
return Linker::linkKnown(
$this->getTitle(),
* @param $output OutputPage to use
*/
protected function showLogFragment( $user, $output ) {
- $output->addHTML( Xml::element( 'h2', null, LogPage::logName( 'rights' ) . "\n" ) );
+ $rightsLogPage = new LogPage( 'rights' );
+ $output->addHTML( Xml::element( 'h2', null, $rightsLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $output, 'rights', $user->getUserPage() );
}
}
'tog-watchlisthideliu' => 'Hide edits by logged in users from the watchlist',
'tog-watchlisthideanons' => 'Hide edits by anonymous users from the watchlist',
'tog-watchlisthidepatrolled' => 'Hide patrolled edits from the watchlist',
-'tog-nolangconversion' => 'Disable variants conversion', # only translate this message to other languages if you have to change it
'tog-ccmeonemails' => 'Send me copies of e-mails I send to other users',
'tog-diffonly' => 'Do not show page content below diffs',
'tog-showhiddencats' => 'Show hidden categories',
',' => '٬', # ٬
);
-$extraUserToggles = array(
- 'nolangconversion'
-);
-
$fallback8bitEncoding = 'windows-1256';
$namespaceNames = array(
'.' => ',',
);
-$extraUserToggles = array(
- 'nolangconversion'
-);
-
$fallback8bitEncoding = 'windows-1251';
$linkTrail = '/^([a-zäçéğıïñöşüýʺʹа-яёәғіқңөұүһٴابپتجحدرزسشعفقكلمنڭەوۇۋۆىيچھ“»]+)(.*)$/sDu';
'.' => ',',
);
-$extraUserToggles = array(
- 'nolangconversion'
-);
-
$fallback8bitEncoding = 'windows-1254';
$namespaceNames = array(
'Разговор_о_МедијаВикију' => NS_MEDIAWIKI_TALK,
);
-
-$extraUserToggles = array(
- 'nolangconversion',
-);
-
$datePreferenceMigrationMap = array(
'default',
'hh:mm d. month y.',
'Razgovor_o_slici' => NS_FILE_TALK,
);
-$extraUserToggles = array(
- 'nolangconversion',
-);
-
$datePreferenceMigrationMap = array(
'default',
'hh:mm d. month y.',
$linkTrail = '/^()(.*)$/sD';
-$extraUserToggles = array(
- 'nolangconversion',
-);
$datePreferences = array(
'default',
'ISO 8601',
'feed-rss',
'unit-pixel',
'userrights-irreversible-marker',
- 'tog-nolangconversion',
'tog-noconvertlink',
'variantname-zh-hans',
'variantname-zh-hant',
'tog-watchlisthideliu',
'tog-watchlisthideanons',
'tog-watchlisthidepatrolled',
- 'tog-nolangconversion',
'tog-ccmeonemails',
'tog-diffonly',
'tog-showhiddencats',
'api-error-file-too-large',
'api-error-filename-tooshort',
'api-error-filetype-banned',
+ 'api-error-filetype-banned-type',
'api-error-filetype-missing',
'api-error-hookaborted',
'api-error-http',