r56688 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56687‎ | r56688 | r56689 >
Date:22:14, 20 September 2009
Author:happy-melon
Status:reverted (Comments)
Tags:
Comment:
(bug16979) Add tracking categories for __INDEX__ and __NOINDEX__.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -3332,25 +3332,39 @@
33333333 }
33343334 if ( isset( $this->mDoubleUnderscores['hiddencat'] ) && $this->mTitle->getNamespace() == NS_CATEGORY ) {
33353335 $this->mOutput->setProperty( 'hiddencat', 'y' );
3336 -
3337 - $containerCategory = Title::makeTitleSafe( NS_CATEGORY, wfMsgForContent( 'hidden-category-category' ) );
3338 - if ( $containerCategory ) {
3339 - $this->mOutput->addCategory( $containerCategory->getDBkey(), $this->getDefaultSort() );
3340 - } else {
3341 - wfDebug( __METHOD__.": [[MediaWiki:hidden-category-category]] is not a valid title!\n" );
3342 - }
 3336+ $this->addTrackingCategory( 'hidden-category-category' );
33433337 }
33443338 # (bug 8068) Allow control over whether robots index a page.
33453339 #
33463340 # FIXME (bug 14899): __INDEX__ always overrides __NOINDEX__ here! This
33473341 # is not desirable, the last one on the page should win.
3348 - if( isset( $this->mDoubleUnderscores['noindex'] ) ) {
 3342+ if( isset( $this->mDoubleUnderscores['noindex'] ) && $this->mTitle->canUseNoindex() ) {
33493343 $this->mOutput->setIndexPolicy( 'noindex' );
3350 - } elseif( isset( $this->mDoubleUnderscores['index'] ) ) {
 3344+ $this->addTrackingCategory( 'noindex-category' );
 3345+ }
 3346+ if( isset( $this->mDoubleUnderscores['index'] ) && $this->mTitle->canUseNoindex() ){
33513347 $this->mOutput->setIndexPolicy( 'index' );
 3348+ $this->addTrackingCategory( 'index-category' );
33523349 }
33533350 wfProfileOut( __METHOD__ );
33543351 return $text;
 3352+ }
 3353+
 3354+ /**
 3355+ * Add a tracking category, getting the title from a system message,
 3356+ * or print a debug message if the title is invalid.
 3357+ * @param $msg String message key
 3358+ * @return Bool whether the addition was successful
 3359+ */
 3360+ protected function addTrackingCategory( $msg ){
 3361+ $containerCategory = Title::makeTitleSafe( NS_CATEGORY, wfMsgForContent( $msg ) );
 3362+ if ( $containerCategory ) {
 3363+ $this->mOutput->addCategory( $containerCategory->getDBkey(), $this->getDefaultSort() );
 3364+ return true;
 3365+ } else {
 3366+ wfDebug( __METHOD__.": [[MediaWiki:$msg]] is not a valid title!\n" );
 3367+ return false;
 3368+ }
33553369 }
33563370
33573371 /**
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -735,6 +735,8 @@
736736 '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.}}',
737737 'category-file-count-limited' => 'The following {{PLURAL:$1|file is|$1 files are}} in the current category.',
738738 'listingcontinuesabbrev' => 'cont.',
 739+'index-category' => 'Indexed pages',
 740+'noindex-category' => 'Noindexed pages',
739741
740742 'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it
741743 'mainpagetext' => "<big>'''MediaWiki has been successfully installed.'''</big>",
Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -236,6 +236,8 @@
237237 * $1: number of files shown',
238238 'listingcontinuesabbrev' => 'Shown in contiuation of each first letter group.
239239 See http://test.wikipedia.org/wiki/Category:Test_ko?uselang={{SUBPAGENAME}}, for example.',
 240+'index-category' => 'Name of the category where pages with the <nowiki>__INDEX__</nowiki> behaviour switch are listed',
 241+'noindex-category' => 'Name of the category where pages with the <nowiki>__NOINDEX__</nowiki> behaviour switch are listed',
240242
241243 'linkprefix' => '{{optional}}',
242244 'mainpagetext' => 'Along with {{msg|mainpagedocfooter}}, the text you will see on the Main Page when your wiki is installed.',
Index: trunk/phase3/RELEASE-NOTES
@@ -238,6 +238,7 @@
239239 * A new permission, 'root', is created. Analogous to root users on Unix systems,
240240 the root permission effectively grants all other permissions on a wiki. Useful
241241 for debugging and administration.
 242+* (bug 16979) Tracking categories for __INDEX__ and __NOINDEX__
242243
243244 === Bug fixes in 1.16 ===
244245
Index: trunk/phase3/maintenance/language/messages.inc
@@ -141,6 +141,8 @@
142142 'category-file-count',
143143 'category-file-count-limited',
144144 'listingcontinuesabbrev',
 145+ 'index-category',
 146+ 'noindex-category',
145147 ),
146148 'mainpage' => array(
147149 'linkprefix',

Follow-up revisions

RevisionCommit summaryAuthorDate
r56937Revert broken rewrite of login system; totally broken....brion00:49, 26 September 2009
r57020Recommit r56688 (tracking categories for __INDEX__ and __NOINDEX__).happy-melon17:55, 28 September 2009

Comments

#Comment by Gurch (talk | contribs)   10:48, 29 September 2009

Would it be better to name the category something less jargony than "Noindexed pages"? "Non-indexed pages" possibly.

Status & tagging log