LogEventsList::showLogExtract(
$wgOut,
'block',
- $user->getUserPage()->getPrefixedText(),
+ $user->getUserPage(),
'',
array(
'lim' => 1,
}
# Give a notice if the user is editing a deleted/moved page...
if ( !$this->mTitle->exists() ) {
- LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), $this->mTitle->getPrefixedText(),
+ LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), $this->mTitle,
'', array( 'lim' => 10,
'conds' => array( "log_action != 'revision'" ),
'showIfEmpty' => false,
# Then it must be protected based on static groups (regular)
$noticeMsg = 'protectedpagewarning';
}
- LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '',
+ LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle, '',
array( 'lim' => 1, 'msgKey' => array( $noticeMsg ) ) );
}
if ( $this->mTitle->isCascadeProtected() ) {
$wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', $cascadeSourcesCount ) );
}
if ( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) ) {
- LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '',
+ LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle, '',
array( 'lim' => 1,
'showIfEmpty' => false,
'msgKey' => array( 'titleprotectedwarning' ),
private function showLogEntries() {
global $wgOut;
$wgOut->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
- LogEventsList::showLogExtract( $wgOut, 'delete', $this->title->getPrefixedText() );
+ LogEventsList::showLogExtract( $wgOut, 'delete', $this->title );
}
/**
LogEventsList::showLogExtract(
$wgOut,
array( 'delete', 'move' ),
- $this->title->getPrefixedText(),
+ $this->title,
'',
array( 'lim' => 10,
'conds' => array( "log_action != 'revision'" ),
* @param $list LogEventsList
* @param $types String or Array: log types to show
* @param $performer String: the user who made the log entries
- * @param $title String: the page title the log entries are for
+ * @param $title String or Title: the page title the log entries are for
* @param $pattern String: do a prefix search rather than an exact title match
* @param $conds Array: extra conditions for the query
* @param $year Integer: the year to start from
* Set the log reader to return only entries affecting the given page.
* (For the block and rights logs, this is a user page.)
*
- * @param $page String: Title name as text
+ * @param $page String or Title object: Title name
* @param $pattern String
*/
private function limitTitle( $page, $pattern ) {
global $wgMiserMode;
- $title = Title::newFromText( $page );
- if( strlen( $page ) == 0 || !$title instanceof Title ) {
- return false;
+ if ( $page instanceof Title ) {
+ $title = $page;
+ } else {
+ $title = Title::newFromText( $page );
+ if( strlen( $page ) == 0 || !$title instanceof Title ) {
+ return false;
+ }
}
$this->title = $title->getPrefixedText();
function showLogExtract( &$out ) {
# Show relevant lines from the protection log:
$out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'protect' ) ) );
- LogEventsList::showLogExtract( $out, 'protect', $this->mTitle->getPrefixedText() );
+ LogEventsList::showLogExtract( $out, 'protect', $this->mTitle );
# Let extensions add other relevant log extracts
wfRunHooks( 'ProtectionForm::showLogExtract', array($this->mArticle,$out) );
}
LogEventsList::showLogExtract(
$out,
'block',
- $userpage->getPrefixedText(),
+ $userpage,
'',
array(
'lim' => 10,
LogEventsList::showLogExtract(
$out,
'suppress',
- $userpage->getPrefixedText(),
+ $userpage,
'',
array(
'lim' => 10,
LogEventsList::showLogExtract(
$out,
'block',
- $nt->getPrefixedText(),
+ $nt,
'',
array(
'lim' => 1,
LogEventsList::showLogExtract(
$out,
'block',
- $nt->getPrefixedText(),
+ $nt,
'',
array(
'lim' => 1,
# Show relevant lines from the deletion log:
$out->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'merge' ) ) . "</h2>\n" );
- LogEventsList::showLogExtract( $out, 'merge', $this->mTargetObj->getPrefixedText() );
+ LogEventsList::showLogExtract( $out, 'merge', $this->mTargetObj );
# When we submit, go by page ID to avoid some nasty but unlikely collisions.
# Such would happen if a page was renamed after the form loaded, but before submit
}
$out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
$out->addWikiMsg( $noticeMsg );
- LogEventsList::showLogExtract( $out, 'protect', $this->oldTitle->getPrefixedText(), '', array( 'lim' => 1 ) );
+ LogEventsList::showLogExtract( $out, 'protect', $this->oldTitle, '', array( 'lim' => 1 ) );
$out->addHTML( "</div>\n" );
}
function showLogFragment( $title ) {
$out = $this->getOutput();
$out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'move' ) ) );
- LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() );
+ LogEventsList::showLogExtract( $out, 'move', $title );
}
function showSubpages( $title ) {
# Show relevant lines from the deletion log
$output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
LogEventsList::showLogExtract( $output, 'delete',
- $this->targetObj->getPrefixedText(), '', array( 'lim' => 25, 'conds' => $qc ) );
+ $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" );
LogEventsList::showLogExtract( $output, 'suppress',
- $this->targetObj->getPrefixedText(), '', array( 'lim' => 25, 'conds' => $qc ) );
+ $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
}
}
# Show relevant lines from the deletion log:
$out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) . "\n" );
- LogEventsList::showLogExtract( $out, 'delete', $this->mTargetObj->getPrefixedText() );
+ LogEventsList::showLogExtract( $out, 'delete', $this->mTargetObj );
# Show relevant lines from the suppression log:
if( $this->getUser()->isAllowed( 'suppressionlog' ) ) {
$out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'suppress' ) ) . "\n" );
- LogEventsList::showLogExtract( $out, 'suppress', $this->mTargetObj->getPrefixedText() );
+ LogEventsList::showLogExtract( $out, 'suppress', $this->mTargetObj );
}
if( $this->mAllowed && ( $haveRevisions || $haveFiles ) ) {
$delNotice = ''; // empty by default
if ( $desiredTitleObj instanceof Title && !$desiredTitleObj->exists() ) {
LogEventsList::showLogExtract( $delNotice, array( 'delete', 'move' ),
- $desiredTitleObj->getPrefixedText(),
+ $desiredTitleObj,
'', array( 'lim' => 10,
'conds' => array( "log_action != 'revision'" ),
'showIfEmpty' => false,
*/
protected function showLogFragment( $user, $output ) {
$output->addHTML( Xml::element( 'h2', null, LogPage::logName( 'rights' ) . "\n" ) );
- LogEventsList::showLogExtract( $output, 'rights', $user->getUserPage()->getPrefixedText() );
+ LogEventsList::showLogExtract( $output, 'rights', $user->getUserPage() );
}
}