Go to the documentation of this file.
35 parent::__construct(
'Protectedpages' );
41 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
44 if ( !mt_rand( 0, 10 ) ) {
49 $type = $request->getVal( $this->IdType );
50 $level = $request->getVal( $this->IdLevel );
51 $sizetype = $request->getVal(
'sizetype' );
52 $size = $request->getIntOrNull(
'size' );
53 $ns = $request->getIntOrNull(
'namespace' );
54 $indefOnly = $request->getBool(
'indefonly' ) ? 1 : 0;
55 $cascadeOnly = $request->getBool(
'cascadeonly' ) ? 1 : 0;
56 $noRedirect = $request->getBool(
'noredirect' ) ? 1 : 0;
82 if ( $pager->getNumRows() ) {
84 $pager->getNavigationBar() .
86 $pager->getNavigationBar()
89 $this->
getOutput()->addWikiMsg(
'protectedpagesempty' );
105 $size, $indefOnly, $cascadeOnly, $noRedirect
118 "<br /><span style='white-space: nowrap'>" .
122 "</span><br /><span style='white-space: nowrap'>" .
141 'selected' => $namespace,
143 'label' => $this->
msg(
'namespace' )->
text()
145 'name' =>
'namespace',
147 'class' =>
'namespaceselector',
159 $this->
msg(
'protectedpages-indef' )->
text(),
172 $this->
msg(
'protectedpages-cascade' )->
text(),
185 $this->
msg(
'protectedpages-noredirect' )->
text(),
198 $max = $sizetype ===
'max';
201 $this->
msg(
'minimum-size' )->
text(),
209 $this->
msg(
'maximum-size' )->
text(),
233 $text = $this->
msg(
"restriction-$type" )->text();
238 foreach ( $m
as $text =>
$type ) {
239 $selected = (
$type == $pr_type );
243 return "<span style='white-space: nowrap'>" .
244 Xml::label( $this->
msg(
'restriction-type' )->
text(), $this->IdType ) .
' ' .
246 array(
'id' => $this->IdType,
'name' => $this->IdType ),
247 implode(
"\n",
$options ) ) .
"</span>";
256 global $wgRestrictionLevels;
259 $m =
array( $this->
msg(
'restriction-level-all' )->
text() => 0 );
263 foreach ( $wgRestrictionLevels
as $type ) {
266 $text = $this->
msg(
"restriction-level-$type" )->text();
272 foreach ( $m
as $text =>
$type ) {
273 $selected = (
$type == $pr_level );
277 return "<span style='white-space: nowrap'>" .
280 array(
'id' => $this->IdLevel,
'name' => $this->IdLevel ),
281 implode(
"\n",
$options ) ) .
"</span>";
285 return 'maintenance';
300 $this->mForm =
$form;
301 $this->mConds = $conds;
304 $this->
namespace = $namespace;
306 $this->size = intval(
$size );
310 parent::__construct(
$form->getContext() );
314 # Do a link batch query
319 $lb->add( $row->page_namespace, $row->page_title );
321 if ( $row->log_user !==
null ) {
322 $userids[] = $row->log_user;
327 if ( count( $userids ) ) {
329 $userCache->doQuery( $userids,
array(), __METHOD__ );
330 foreach ( $userids
as $userid ) {
331 $name = $userCache->getProp( $userid,
'name' );
332 if (
$name !==
false ) {
343 static $headers =
null;
345 if ( $headers ==
array() ) {
347 'log_timestamp' =>
'protectedpages-timestamp',
348 'pr_page' =>
'protectedpages-page',
349 'pr_expiry' =>
'protectedpages-expiry',
350 'log_user' =>
'protectedpages-performer',
351 'pr_params' =>
'protectedpages-params',
352 'log_comment' =>
'protectedpages-reason',
354 foreach ( $headers
as $key => $val ) {
355 $headers[$key] = $this->
msg( $val )->text();
375 case 'log_timestamp':
380 array(
'class' =>
'mw-protectedpages-unknown' ),
381 $this->
msg(
'protectedpages-unknown-timestamp' )->escaped()
393 array(
'class' =>
'mw-invalidtitle' ),
396 $row->page_namespace,
403 if ( !is_null( $row->page_len ) ) {
407 array(
'class' =>
'mw-protectedpages-length' ),
419 $this->
msg(
'protect_change' )->escaped(),
421 array(
'action' =>
'unprotect' )
425 array(
'class' =>
'mw-protectedpages-actions' ),
426 $this->
msg(
'parentheses' )->rawParams( $changeProtection )->escaped()
433 if ( $row->log_timestamp ===
null ) {
436 array(
'class' =>
'mw-protectedpages-unknown' ),
437 $this->
msg(
'protectedpages-unknown-performer' )->escaped()
442 if ( $username ===
false ) {
443 $formatted = htmlspecialchars(
$value );
449 $formatted = $this->
msg(
'rev-deleted-user' )->escaped();
452 $formatted =
'<span class="history-deleted">' . $formatted .
'</span>';
460 $params[] = $this->
msg(
'restriction-level-' . $row->pr_level )->escaped();
461 if ( $row->pr_cascade ) {
462 $params[] = $this->
msg(
'protect-summary-cascade' )->text();
469 if ( $row->log_timestamp ===
null ) {
472 array(
'class' =>
'mw-protectedpages-unknown' ),
473 $this->
msg(
'protectedpages-unknown-reason' )->escaped()
479 $formatted = $this->
msg(
'rev-deleted-comment' )->escaped();
482 $formatted =
'<span class="history-deleted">' . $formatted .
'</span>';
496 $conds[] =
'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
497 'OR pr_expiry IS NULL';
498 $conds[] =
'page_id=pr_page';
499 $conds[] =
'pr_type=' . $this->mDb->addQuotes( $this->
type );
501 if ( $this->sizetype ==
'min' ) {
503 } elseif ( $this->sizetype ==
'max' ) {
507 if ( $this->indefonly ) {
508 $infinity = $this->mDb->addQuotes( $this->mDb->getInfinity() );
509 $conds[] =
"pr_expiry = $infinity OR pr_expiry IS NULL";
511 if ( $this->cascadeonly ) {
512 $conds[] =
'pr_cascade = 1';
514 if ( $this->noredirect ) {
515 $conds[] =
'page_is_redirect = 0';
518 if ( $this->level ) {
519 $conds[] =
'pr_level=' . $this->mDb->addQuotes( $this->level );
521 if ( !is_null( $this->
namespace ) ) {
522 $conds[] =
'page_namespace=' . $this->mDb->addQuotes( $this->
namespace );
526 'tables' =>
array(
'page',
'page_restrictions',
'log_search',
'logging' ),
542 'join_conds' =>
array(
543 'log_search' =>
array(
545 'ls_field' =>
'pr_id',
'ls_value = pr_id'
558 return 'TablePager mw-protectedpages';
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
getPageTitle( $subpage=false)
Get a self-referential title object.
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
getContext()
Get the RequestContext object.
execute( $par)
Default execute method Checks user permissions, calls the function given in mFunction.
static getFilteredRestrictionTypes( $exists=true)
Get a filtered list of all restriction types supported by this wiki.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
msg()
Get a Message object with context set Parameters are the same as wfMessage()
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
getOutput()
Get the OutputPage being used for this instance.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead $form
static option( $text, $value=null, $selected=false, $attribs=array())
Convenience function to build an HTML drop-down list item.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
static formatComment( $comment, $title=null, $local=false)
This function is called by all recent changes variants, by the page history, and by the user contribu...
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
getUser()
Get the User object.
getSizeLimit( $sizetype, $size)
static openElement( $element, $attribs=null)
This opens an XML element.
static radioLabel( $label, $name, $value, $id, $checked=false, $attribs=array())
Convenience function to build an HTML radio button with a label.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
getLanguage()
Get the Language object.
if( $wgAPIRequestLog) $lb
getRedirectCheck( $noRedirect)
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
A special page that lists protected pages.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
when a variable name is used in a it is silently declared as a new masking the global
showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect)
getLevelMenu( $pr_level)
Creates the input label of the restriction level.
getTypeMenu( $pr_type)
Creates the input label of the restriction type.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
presenting them properly to the user as errors is done by the caller $title
Allows to change the fields on the form that will be generated $name
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
getNamespaceMenu( $namespace=null)
Prepare the namespace filter drop-down; standard namespace selector, sans the MediaWiki namespace.
getRequest()
Get the WebRequest being used for this instance.
static formatRevisionSize( $size)
static closeElement( $element)
Shortcut to close an XML element.
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
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
getCascadeCheck( $cascadeOnly)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static namespaceSelector(array $params=array(), array $selectAttribs=array())
Build a drop-down box for selecting a namespace.
static isDeleted( $row, $field)
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
static input( $name, $size=false, $value=false, $attribs=array())
Convenience function to build an HTML text input field.
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
static label( $label, $id, $attribs=array())
Convenience function to build an HTML form label.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
static purgeExpiredRestrictions()
Purge expired restrictions from the page_restrictions table.
getExpiryCheck( $indefOnly)