* A new permission, 'root', is created. Analogous to root users on Unix systems,
the root permission effectively grants all other permissions on a wiki. Useful
for debugging and administration.
+* (bug 16979) Tracking categories for __INDEX__ and __NOINDEX__
=== Bug fixes in 1.16 ===
}
if ( isset( $this->mDoubleUnderscores['hiddencat'] ) && $this->mTitle->getNamespace() == NS_CATEGORY ) {
$this->mOutput->setProperty( 'hiddencat', 'y' );
-
- $containerCategory = Title::makeTitleSafe( NS_CATEGORY, wfMsgForContent( 'hidden-category-category' ) );
- if ( $containerCategory ) {
- $this->mOutput->addCategory( $containerCategory->getDBkey(), $this->getDefaultSort() );
- } else {
- wfDebug( __METHOD__.": [[MediaWiki:hidden-category-category]] is not a valid title!\n" );
- }
+ $this->addTrackingCategory( 'hidden-category-category' );
}
# (bug 8068) Allow control over whether robots index a page.
#
# FIXME (bug 14899): __INDEX__ always overrides __NOINDEX__ here! This
# is not desirable, the last one on the page should win.
- if( isset( $this->mDoubleUnderscores['noindex'] ) ) {
+ if( isset( $this->mDoubleUnderscores['noindex'] ) && $this->mTitle->canUseNoindex() ) {
$this->mOutput->setIndexPolicy( 'noindex' );
- } elseif( isset( $this->mDoubleUnderscores['index'] ) ) {
+ $this->addTrackingCategory( 'noindex-category' );
+ }
+ if( isset( $this->mDoubleUnderscores['index'] ) && $this->mTitle->canUseNoindex() ){
$this->mOutput->setIndexPolicy( 'index' );
+ $this->addTrackingCategory( 'index-category' );
}
wfProfileOut( __METHOD__ );
return $text;
+ }
+
+ /**
+ * Add a tracking category, getting the title from a system message,
+ * or print a debug message if the title is invalid.
+ * @param $msg String message key
+ * @return Bool whether the addition was successful
+ */
+ protected function addTrackingCategory( $msg ){
+ $containerCategory = Title::makeTitleSafe( NS_CATEGORY, wfMsgForContent( $msg ) );
+ if ( $containerCategory ) {
+ $this->mOutput->addCategory( $containerCategory->getDBkey(), $this->getDefaultSort() );
+ return true;
+ } else {
+ wfDebug( __METHOD__.": [[MediaWiki:$msg]] is not a valid title!\n" );
+ return false;
+ }
}
/**
'category-file-count' => '{{PLURAL:$2|This category contains only the following file.|The following {{PLURAL:$1|file is|$1 files are}} in this category, out of $2 total.}}',
'category-file-count-limited' => 'The following {{PLURAL:$1|file is|$1 files are}} in the current category.',
'listingcontinuesabbrev' => 'cont.',
+'index-category' => 'Indexed pages',
+'noindex-category' => 'Noindexed pages',
'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it
'mainpagetext' => "<big>'''MediaWiki has been successfully installed.'''</big>",
* $1: number of files shown',
'listingcontinuesabbrev' => 'Shown in contiuation of each first letter group.
See http://test.wikipedia.org/wiki/Category:Test_ko?uselang={{SUBPAGENAME}}, for example.',
+'index-category' => 'Name of the category where pages with the <nowiki>__INDEX__</nowiki> behaviour switch are listed',
+'noindex-category' => 'Name of the category where pages with the <nowiki>__NOINDEX__</nowiki> behaviour switch are listed',
'linkprefix' => '{{optional}}',
'mainpagetext' => 'Along with {{msg|mainpagedocfooter}}, the text you will see on the Main Page when your wiki is installed.',