Go to the documentation of this file.
34 parent::__construct(
'Protectedtitles' );
42 if ( !mt_rand( 0, 10 ) ) {
47 $type = $request->getVal( $this->IdType );
48 $level = $request->getVal( $this->IdLevel );
49 $sizetype = $request->getVal(
'sizetype' );
50 $size = $request->getIntOrNull(
'size' );
51 $NS = $request->getIntOrNull(
'namespace' );
57 if ( $pager->getNumRows() ) {
59 $pager->getNavigationBar() .
60 '<ul>' . $pager->getBody() .
'</ul>' .
61 $pager->getNavigationBar()
64 $this->
getOutput()->addWikiMsg(
'protectedtitlesempty' );
77 static $infinity =
null;
79 if ( is_null( $infinity ) ) {
92 array(
'class' =>
'mw-invalidtitle' ),
103 $description_items =
array();
105 $protType = $this->
msg(
'restriction-level-' . $row->pt_create_perm )->escaped();
106 $description_items[] = $protType;
108 $expiry = strlen( $row->pt_expiry ) ?
109 $lang->formatExpiry( $row->pt_expiry,
TS_MW ) :
112 if ( $expiry != $infinity ) {
114 $description_items[] = $this->
msg(
115 'protect-expiring-local',
116 $lang->userTimeAndDate( $expiry,
$user ),
117 $lang->userDate( $expiry,
$user ),
118 $lang->userTime( $expiry,
$user )
125 return '<li>' . $lang->specialList(
$link, implode( $description_items,
', ' ) ) .
"</li>\n";
137 $action = htmlspecialchars( $wgScript );
141 return "<form action=\"$action\" method=\"get\">\n" .
148 "</fieldset></form>";
161 'selected' => $namespace,
163 'label' => $this->
msg(
'namespace' )->
text()
165 'name' =>
'namespace',
167 'class' =>
'namespaceselector',
178 global $wgRestrictionLevels;
181 $m =
array( $this->
msg(
'restriction-level-all' )->
text() => 0 );
185 foreach ( $wgRestrictionLevels
as $type ) {
188 $text = $this->
msg(
"restriction-level-$type" )->text();
194 if ( count( $m ) <= 2 ) {
198 foreach ( $m
as $text =>
$type ) {
199 $selected = (
$type == $pr_level );
203 return Xml::label( $this->
msg(
'restriction-level' )->
text(), $this->IdLevel ) .
' ' .
205 array(
'id' => $this->IdLevel,
'name' => $this->IdLevel ),
210 return 'maintenance';
222 $sizetype =
'',
$size = 0
224 $this->mForm =
$form;
225 $this->mConds = $conds;
226 $this->level = $level;
227 $this->
namespace = $namespace;
228 $this->size = intval(
$size );
229 parent::__construct(
$form->getContext() );
234 # Do a link batch query
235 $this->mResult->seek( 0 );
238 foreach ( $this->mResult
as $row ) {
239 $lb->add( $row->pt_namespace, $row->pt_title );
252 return $this->mForm->getTitle();
256 return $this->mForm->formatRow( $row );
264 $conds[] =
'pt_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
265 if ( $this->level ) {
266 $conds[
'pt_create_perm'] = $this->level;
269 if ( !is_null( $this->
namespace ) ) {
270 $conds[] =
'pt_namespace=' . $this->mDb->addQuotes( $this->
namespace );
274 'tables' =>
'protected_titles',
275 'fields' =>
array(
'pt_namespace',
'pt_title',
'pt_create_perm',
276 'pt_expiry',
'pt_timestamp' ),
282 return 'pt_timestamp';
getPageTitle( $subpage=false)
Get a self-referential title object.
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
showOptions( $namespace, $type='edit', $level)
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.
getOutput()
Get the OutputPage being used for this instance.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
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.
wfProfileIn( $functionname)
Begin profiling of a function.
A special page that list protected titles from creation.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
getLanguage()
Shortcut to get user's language.
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
formatRow( $row)
Callback function to output a restriction.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
if( $wgAPIRequestLog) $lb
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
getNamespaceMenu( $namespace=null)
Prepare the namespace filter drop-down; standard namespace selector, sans the MediaWiki namespace.
execute( $par)
Default execute method Checks user permissions, calls the function given in mFunction.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
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!
getUser()
Shortcut to get the User executing this instance.
when a variable name is used in a it is silently declared as a new masking the global
getContext()
Gets the context this SpecialPage is executed in.
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
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
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
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
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 submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
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...
namespace and then decline to actually register it RecentChangesLinked and Watchlist $special
static purgeExpiredRestrictions()
Purge expired restrictions from the page_restrictions table.