18use Wikimedia\Timestamp\TimestampFormat as TS;
30 private readonly ?
string $level,
31 private readonly ?
int $namespace,
35 parent::__construct( $context, $linkRenderer );
40 $this->mResult->seek( 0 );
42 $lb = $this->linkBatchFactory->newLinkBatch()->setCaller( __METHOD__ );
43 foreach ( $this->mResult as $row ) {
44 $lb->add( $row->pt_namespace, $row->pt_title );
51 $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
53 return Html::rawElement(
58 [
'class' =>
'mw-invalidtitle' ],
59 Linker::getInvalidTitleDescription(
70 $description = $this->
msg(
'restriction-level-' . $row->pt_create_perm )->escaped();
72 $expiry = strlen( $row->pt_expiry ) ?
73 $lang->formatExpiry( $row->pt_expiry, TS::MW ) :
76 if ( $expiry !==
'infinity' ) {
78 $description .= $this->
msg(
'comma-separator' )->escaped() . $this->
msg(
79 'protect-expiring-local',
80 $lang->userTimeAndDate( $expiry, $user ),
81 $lang->userDate( $expiry, $user ),
82 $lang->userTime( $expiry, $user )
86 return '<li>' . $lang->specialList( $link, $description ) .
"</li>\n";
95 $dbr->expr(
'pt_expiry',
'>', $this->mDb->timestamp() )
96 ->or(
'pt_expiry',
'=',
null ),
99 $conds[
'pt_create_perm'] = $this->level;
102 if ( $this->
namespace !==
null ) {
103 $conds[] = $dbr->expr(
'pt_namespace',
'=', $this->
namespace );
107 'tables' =>
'protected_titles',
108 'fields' => [
'pt_namespace',
'pt_title',
'pt_create_perm',
109 'pt_expiry',
'pt_timestamp' ],
116 return [ [
'pt_timestamp',
'pt_namespace',
'pt_title' ] ];
124class_alias( ProtectedTitlesPager::class,
'ProtectedTitlesPager' );
127class_alias( ProtectedTitlesPager::class,
'MediaWiki\\Pager\\ProtectedTitlesPager' );
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
getContext()
Get the base IContextSource object.
Factory for LinkBatch objects to batch query page metadata.
Interface for objects which can provide a MediaWiki context on request.