Disabled by default, enabled with inprop=protections,
returned as 'restrictiontypes', also for non-existing titles.
Change-Id: I98604b60626b84bd8cb601a4149b80db1b6787b7
* (T78737) action=expandtemplates can now return page properties.
* (T78690) list=allimages now accepts multiple pipe-separated values
for the 'aimime' parameter.
* (T78737) action=expandtemplates can now return page properties.
* (T78690) list=allimages now accepts multiple pipe-separated values
for the 'aimime' parameter.
+* prop=info with inprop=protections will now return applicable protection types
+ with the 'restrictiontypes' key.
=== Action API internal changes in 1.25 ===
* ApiHelp has been rewritten to support i18n and paginated HTML output.
=== Action API internal changes in 1.25 ===
* ApiHelp has been rewritten to support i18n and paginated HTML output.
private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
$pageLatest, $pageLength;
private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
$pageLatest, $pageLength;
- private $protections, $watched, $watchers, $notificationtimestamps,
+ private $protections, $restrictionTypes, $watched, $watchers, $notificationtimestamps,
$talkids, $subjectids, $displaytitles;
private $showZeroWatchers = false;
$talkids, $subjectids, $displaytitles;
private $showZeroWatchers = false;
$this->protections[$ns][$dbkey];
}
$this->getResult()->setIndexedTagName( $pageInfo['protection'], 'pr' );
$this->protections[$ns][$dbkey];
}
$this->getResult()->setIndexedTagName( $pageInfo['protection'], 'pr' );
+
+ $pageInfo['restrictiontypes'] = array();
+ if ( isset( $this->restrictionTypes[$ns][$dbkey] ) ) {
+ $pageInfo['restrictiontypes'] =
+ $this->restrictionTypes[$ns][$dbkey];
+ }
+ $this->getResult()->setIndexedTagName( $pageInfo['restrictiontypes'], 'rt' );
}
if ( $this->fld_watched && isset( $this->watched[$ns][$dbkey] ) ) {
}
if ( $this->fld_watched && isset( $this->watched[$ns][$dbkey] ) ) {
- // Cascading protections
+ // Separate good and missing titles into files and other pages
+ // and populate $this->restrictionTypes
$images = $others = array();
foreach ( $this->everything as $title ) {
if ( $title->getNamespace() == NS_FILE ) {
$images = $others = array();
foreach ( $this->everything as $title ) {
if ( $title->getNamespace() == NS_FILE ) {
} else {
$others[] = $title;
}
} else {
$others[] = $title;
}
+ // Applicable protection types
+ $this->restrictionTypes[$title->getNamespace()][$title->getDBkey()] =
+ array_values( $title->getRestrictionTypes() );
}
if ( count( $others ) ) {
}
if ( count( $others ) ) {