52 $this->mConds = $conds;
55 $this->
namespace = $namespace;
57 $this->size = intval(
$size );
62 parent::__construct( $form->getContext() );
66 # Do a link batch query
70 foreach ( $result as $row ) {
71 $lb->
add( $row->page_namespace, $row->page_title );
73 if ( $row->log_user !==
null ) {
74 $userids[] = $row->log_user;
79 if ( count( $userids ) ) {
81 $userCache->doQuery( $userids, [], __METHOD__ );
82 foreach ( $userids as $userid ) {
83 $name = $userCache->getProp( $userid,
'name' );
84 if ( $name !==
false ) {
85 $lb->add( NS_USER, $name );
95 static $headers =
null;
97 if ( $headers == [] ) {
99 'log_timestamp' =>
'protectedpages-timestamp',
100 'pr_page' =>
'protectedpages-page',
101 'pr_expiry' =>
'protectedpages-expiry',
102 'log_user' =>
'protectedpages-performer',
103 'pr_params' =>
'protectedpages-params',
104 'log_comment' =>
'protectedpages-reason',
106 foreach ( $headers as $key => $val ) {
107 $headers[$key] = $this->
msg( $val )->text();
125 case 'log_timestamp':
128 $formatted = Html::rawElement(
130 [
'class' =>
'mw-protectedpages-unknown' ],
131 $this->
msg(
'protectedpages-unknown-timestamp' )->escaped()
134 $formatted = htmlspecialchars( $this->
getLanguage()->userTimeAndDate(
140 $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
142 $formatted = Html::element(
144 [
'class' =>
'mw-invalidtitle' ],
147 $row->page_namespace,
152 $formatted = $this->linkRenderer->makeLink( $title );
154 if ( !is_null( $row->page_len ) ) {
156 ' ' . Html::rawElement(
158 [
'class' =>
'mw-protectedpages-length' ],
165 $formatted = htmlspecialchars( $this->
getLanguage()->formatExpiry(
167 $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
168 if ( $this->
getUser()->isAllowed(
'protect' ) && $title ) {
169 $changeProtection = $this->linkRenderer->makeKnownLink(
171 $this->
msg(
'protect_change' )->
text(),
173 [
'action' =>
'unprotect' ]
175 $formatted .=
' ' . Html::rawElement(
177 [
'class' =>
'mw-protectedpages-actions' ],
178 $this->
msg(
'parentheses' )->rawParams( $changeProtection )->escaped()
185 if ( $row->log_timestamp ===
null ) {
186 $formatted = Html::rawElement(
188 [
'class' =>
'mw-protectedpages-unknown' ],
189 $this->
msg(
'protectedpages-unknown-performer' )->escaped()
199 $formatted = htmlspecialchars(
$value );
205 $formatted = $this->
msg(
'rev-deleted-user' )->escaped();
208 $formatted =
'<span class="history-deleted">' . $formatted .
'</span>';
216 $params[] = $this->
msg(
'restriction-level-' . $row->pr_level )->escaped();
217 if ( $row->pr_cascade ) {
218 $params[] = $this->
msg(
'protect-summary-cascade' )->escaped();
225 if ( $row->log_timestamp ===
null ) {
226 $formatted = Html::rawElement(
228 [
'class' =>
'mw-protectedpages-unknown' ],
229 $this->
msg(
'protectedpages-unknown-reason' )->escaped()
237 $value = CommentStore::getStore()->getComment(
'log_comment', $row )->text;
240 $formatted = $this->
msg(
'rev-deleted-comment' )->escaped();
243 $formatted =
'<span class="history-deleted">' . $formatted .
'</span>';
257 $conds[] =
'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
258 ' OR pr_expiry IS NULL';
259 $conds[] =
'page_id=pr_page';
260 $conds[] =
'pr_type=' . $this->mDb->addQuotes( $this->
type );
262 if ( $this->sizetype ==
'min' ) {
264 } elseif ( $this->sizetype ==
'max' ) {
268 if ( $this->indefonly ) {
269 $infinity = $this->mDb->addQuotes( $this->mDb->getInfinity() );
270 $conds[] =
"pr_expiry = $infinity OR pr_expiry IS NULL";
272 if ( $this->cascadeonly ) {
273 $conds[] =
'pr_cascade = 1';
275 if ( $this->noredirect ) {
276 $conds[] =
'page_is_redirect = 0';
279 if ( $this->level ) {
280 $conds[] =
'pr_level=' . $this->mDb->addQuotes( $this->level );
282 if ( !is_null( $this->
namespace ) ) {
283 $conds[] =
'page_namespace=' . $this->mDb->addQuotes( $this->
namespace );
286 $commentQuery = CommentStore::getStore()->getJoin(
'log_comment' );
287 $actorQuery = ActorMigration::newMigration()->getJoin(
'log_user' );
291 'page',
'page_restrictions',
'log_search',
292 'logparen' => [
'logging' ] + $commentQuery[
'tables'] + $actorQuery[
'tables'],
305 ] + $commentQuery[
'fields'] + $actorQuery[
'fields'],
310 'ls_field' =>
'pr_id',
'ls_value = ' . $this->mDb->buildStringCast(
'pr_id' )
318 ] + $commentQuery[
'joins'] + $actorQuery[
'joins']
323 return parent::getTableClass() .
' mw-protectedpages';
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getContext()
Get the base IContextSource object.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
static formatRevisionSize( $size)
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
static isDeleted( $row, $field)
this hook is for auditing only or null if authentication failed before getting that far $username
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type