// XXX This all needs to use Pager, ugly hack for now.
global $wgMiserMode;
- if ($wgMiserMode && ($this->offset >10000)) $this->offset=10000;
+ if( $wgMiserMode )
+ $this->offset = min( $this->offset, 10000 );
}
/**
function limitTitle( $page , $pattern ) {
global $wgMiserMode;
$title = Title::newFromText( $page );
- if( empty( $page ) || is_null( $title ) ) {
+
+ if( strlen( $page ) == 0 || !$title instanceof Title )
return false;
- }
+
$this->title =& $title;
$this->pattern = $pattern;
$ns = $title->getNamespace();
return $this->title->getPrefixedText();
}
}
+
+ /**
+ * Is there at least one row?
+ *
+ * @return bool
+ */
+ public function hasRows() {
+ # Little hack...
+ $limit = $this->limit;
+ $this->limit = 1;
+ $res = $this->db->query( $this->getQuery() );
+ $this->limit = $limit;
+ $ret = $this->db->numRows( $res ) > 0;
+ $this->db->freeResult( $res );
+ return $ret;
+ }
+
}
/**
if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) {
$destTitle = Title::newFromText( $paramArray[0] );
if ( $destTitle ) {
- $reviewlink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
+ $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
wfMsg( 'revertmove' ),
'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
'&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
'&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
- '&wpMovetalk=0' );
+ '&wpMovetalk=0' ) . ')';
}
// show undelete link
} elseif ( $s->log_action == 'delete' && $wgUser->isAllowed( 'delete' ) ) {
wfMsg( 'unblocklink' ),
'action=unblock&ip=' . urlencode( $s->log_title ) ) . ')';
// show change protection link
- } elseif ( $s->log_action == 'protect' && $wgUser->isAllowed( 'protect' ) ) {
- $revert = '(' . $skin->makeKnownLink( $title->getPrefixedDBkey() ,
- wfMsg( 'protect_change' ),
- 'action=unprotect' ) . ')';
+ } elseif ( ( $s->log_action == 'protect' || $s->log_action == 'modify' ) && $wgUser->isAllowed( 'protect' ) ) {
+ $revert = '(' . $skin->makeKnownLinkObj( $title, wfMsg( 'protect_change' ), 'action=unprotect' ) . ')';
// show user tool links for self created users
+ // TODO: The extension should be handling this, get it out of core!
} elseif ( $s->log_action == 'create2' ) {
- $revert = $this->skin->userToolLinksRedContribs( $s->log_user, $s->log_title );
- // do not show $comment for self created accounts. It includes wrong user tool links:
- // 'blockip' for users w/o block allowance and broken links for very long usernames (bug 4756)
+ if( isset( $paramArray[0] ) ) {
+ $revert = $this->skin->userToolLinks( $paramArray[0], $s->log_title, true );
+ } else {
+ # Fall back to a blue contributions link
+ $revert = $this->skin->userToolLinks( 1, $s->log_title );
+ }
+ # Suppress $comment from old entries, not needed and can contain incorrect links
$comment = '';
}
*/
function getTitlePattern() {
$pattern = $this->reader->queryPattern();
- return Xml::checkLabel( wfMsg( 'title-pattern' ), 'pattern', 'pattern', $pattern );
+ return Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $pattern );
}
/**
}
-?>
+