r67181 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67180‎ | r67181 | r67182 >
Date:11:58, 1 June 2010
Author:tstarling
Status:deferred
Tags:
Comment:
Merged all changes from r62820 to r67179 from trunk, to get r66987 and r67179 as well as code style changes in the base.
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/CategoryTree (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryPageSubclass.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.alias.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.css (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.i18n.magic.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.i18n.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTreePage.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/README (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryPageSubclass.php
@@ -3,6 +3,7 @@
44 class CategoryTreeCategoryPage extends CategoryPage {
55 function closeShowCategory() {
66 global $wgOut, $wgRequest;
 7+
78 $from = $wgRequest->getVal( 'from' );
89 $until = $wgRequest->getVal( 'until' );
910
@@ -17,7 +18,7 @@
1819 function getCategoryTree() {
1920 global $wgOut, $wgCategoryTreeCategoryPageOptions, $wgCategoryTreeForceHeaders;
2021
21 - if ( ! isset($this->categorytree) ) {
 22+ if ( ! isset( $this->categorytree ) ) {
2223 if ( !$wgCategoryTreeForceHeaders ) CategoryTree::setHeaders( $wgOut );
2324
2425 $this->categorytree = new CategoryTree( $wgCategoryTreeCategoryPageOptions );
@@ -38,11 +39,6 @@
3940 return parent::addSubcategoryObject( $cat, $sortkey, $pageLength );
4041 }
4142
42 - /*if ( ! $GLOBALS['wgCategoryTreeUnifiedView'] ) {
43 - $this->child_cats[] = $cat;
44 - return parent::addSubcategory( $cat, $sortkey, $pageLength );
45 - }*/
46 -
4743 $tree = $this->getCategoryTree();
4844
4945 $this->children[] = $tree->renderNodeInfo( $title, $cat );
@@ -56,7 +52,7 @@
5753 }
5854
5955 function finaliseCategoryState() {
60 - if( $this->flip ) {
 56+ if ( $this->flip ) {
6157 $this->child_cats = array_reverse( $this->child_cats );
6258 }
6359 parent::finaliseCategoryState();
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.i18n.magic.php
@@ -30,6 +30,10 @@
3131 'categorytree' => array( '0', 'GwezennadurRummad', 'categorytree' ),
3232 );
3333
 34+$magicWords['eo'] = array(
 35+ 'categorytree' => array( '0', 'kategoriarbo', 'categorytree' ),
 36+);
 37+
3438 $magicWords['es'] = array(
3539 'categorytree' => array( '0', 'árboldecategorías', 'arboldecategorias', 'categorytree' ),
3640 );
@@ -38,6 +42,10 @@
3943 'categorytree' => array( '0', 'kategooriapuu', 'categorytree' ),
4044 );
4145
 46+$magicWords['ja'] = array(
 47+ 'categorytree' => array( '0', 'カテゴリツリー', 'categorytree' ),
 48+);
 49+
4250 $magicWords['ko'] = array(
4351 'categorytree' => array( '0', '분류트리', 'categorytree' ),
4452 );
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTreePage.php
@@ -9,13 +9,12 @@
1010 * @license GNU General Public Licence 2.0 or later
1111 */
1212
13 -if( !defined( 'MEDIAWIKI' ) ) {
 13+if ( !defined( 'MEDIAWIKI' ) ) {
1414 echo( "This file is part of an extension to the MediaWiki software and cannot be used standalone.\n" );
1515 die( 1 );
1616 }
1717
1818 class CategoryTreePage extends SpecialPage {
19 -
2019 var $target = '';
2120 var $tree = null;
2221
@@ -45,11 +44,11 @@
4645 $this->setHeaders();
4746
4847 if ( $par ) $this->target = $par;
49 - else $this->target = $wgRequest->getVal( 'target', wfMsg( 'rootcategory') );
 48+ else $this->target = $wgRequest->getVal( 'target', wfMsg( 'rootcategory' ) );
5049
5150 $this->target = trim( $this->target );
5251
53 - #HACK for undefined root category
 52+ # HACK for undefined root category
5453 if ( $this->target == '<rootcategory>' || $this->target == '&lt;rootcategory&gt;' ) $this->target = null;
5554
5655 $options = array();
@@ -68,7 +67,7 @@
6968
7069 $this->executeInputForm();
7170
72 - if( $this->target !== '' && $this->target !== null ) {
 71+ if ( $this->target !== '' && $this->target !== null ) {
7372 if ( !$wgCategoryTreeForceHeaders ) CategoryTree::setHeaders( $wgOut );
7473
7574 $title = CategoryTree::makeTitle( $this->target );
@@ -98,7 +97,6 @@
9998 $wgOut->addHTML( Xml::closeElement( 'div' ) );
10099 }
101100 }
102 -
103101 }
104102
105103 /**
@@ -107,7 +105,7 @@
108106 function executeInputForm() {
109107 global $wgScript, $wgOut;
110108 $thisTitle = Title::makeTitle( NS_SPECIAL, $this->getName() );
111 - $mode = $this->getOption('mode');
 109+ $mode = $this->getOption( 'mode' );
112110
113111 $wgOut->addHTML( Xml::openElement( 'form', array( 'name' => 'categorytree', 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-categorytree-form' ) ) );
114112 $wgOut->addHTML( Xml::openElement( 'fieldset' ) );
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.i18n.php
@@ -82,12 +82,12 @@
8383 {{Identical|All pages}}',
8484 'categorytree-collapse' => 'Tooltip for the "collapse" button',
8585 'categorytree-expand' => 'Tooltip for the "expand" button',
86 - 'categorytree-member-counts' => 'Tooltip showing a detailed summary of subcategory member counts. Parameters:
87 -* $1 = number of subcategories,
88 -* $2 = number of pages (without subcategories and files),
89 -* $3 = number of files,
90 -* $4 = total number of members,
91 -* $5 = members to be shown in the tree, depending on mode.
 86+ 'categorytree-member-counts' => 'Tooltip showing a detailed summary of subcategory member counts. Parameters:
 87+* $1 = number of subcategories,
 88+* $2 = number of pages (without subcategories and files),
 89+* $3 = number of files,
 90+* $4 = total number of members,
 91+* $5 = members to be shown in the tree, depending on mode.
9292 Use with { {PLURAL} }',
9393 'categorytree-load' => '{{Identical|Load}}
9494
@@ -143,7 +143,7 @@
144144 'categorytree' => 'የመደቦች ዛፍ',
145145 'categorytree-portlet' => 'መደቦች',
146146 'categorytree-legend' => 'የመደቦች ዛፍ ለማየት',
147 - 'categorytree-header' => "[+] ተጭነው ንዑሱ-መደብ ይዘረጋል፣ [-] ተጭነው ደግሞ ይመልሳል።
 147+ 'categorytree-header' => "[+] ተጭነው ንዑሱ-መደብ ይዘረጋል፣ [-] ተጭነው ደግሞ ይመልሳል።
148148
149149 በግራ በኩል ባለው ሳጥን ውስጥ የመደቡን ስም ዝም ብለው መጻፍ ይችላሉ። (የዚሁ ዊኪ መደብ ስሞች ለመመልከት፣ [[Special:Mostlinkedcategories|እዚህ ይጫኑ]]።) ከዚያ፥ ምን ያሕል ንዑስ-መደቦች እንዳሉበት ለማየት «ዛፉ ይታይ» የሚለውን ይጫኑ። በቀኝ በኩል ካለው ሳጥን 'all pages' ከመረጡ፥ በየመደቡ ውስጥ ያሉት መጣጥፎች በተጨማሪ ይታያሉ።
150150
@@ -516,7 +516,7 @@
517517 'categorytree-portlet' => 'Rummadoù',
518518 'categorytree-legend' => 'Gwelet gwezennadur ar rummad',
519519 'categorytree-desc' => 'Furchal a ra ent dinamek [[Special:CategoryTree|framm ar rummadoù]]',
520 - 'categorytree-header' => "Merkit anv ur rummad evit gwelet petra zo ennañ e stumm ur gwezennadur.
 520+ 'categorytree-header' => "Merkit anv ur rummad evit gwelet petra zo ennañ e stumm ur gwezennadur.
521521 Notit e rankit kaout an arc'hwelioù JavaScript araokaet anvet AJAX.
522522 M'eo kozh-mat stumm ho merdeer pe m'eo diweredekaet JavaScript ganeoc'h, ne'z aio ket en-dro.",
523523 'categorytree-category' => 'Rummad :',
@@ -693,8 +693,8 @@
694694 'categorytree-portlet' => 'Categorïau',
695695 'categorytree-legend' => 'Dangos y goeden gategori',
696696 'categorytree-desc' => "Teclyn AJAX yn arddangos [[Special:CategoryTree|adeiledd categorïau]]'r wici",
697 - 'categorytree-header' => "Teipiwch enw categori yn y blwch er mwyn gweld ei gynnwys ar lun coeden.
698 -Sylwer bod yn rhaid defnyddio offer uwch Sgript Java o'r enw AJAX er mwyn gwneud hyn.
 697+ 'categorytree-header' => "Teipiwch enw categori yn y blwch er mwyn gweld ei gynnwys ar lun coeden.
 698+Sylwer bod yn rhaid defnyddio offer uwch Sgript Java o'r enw AJAX er mwyn gwneud hyn.
699699 Ni lwydda'r gofyniad os yw'ch porwr yn hen iawn neu os nad yw Sgript Java wedi ei alluogi.",
700700 'categorytree-category' => 'Categori:',
701701 'categorytree-go' => 'Dangos y Goeden',
@@ -1034,6 +1034,7 @@
10351035 );
10361036
10371037 /** Persian (فارسی)
 1038+ * @author Ebraminio
10381039 * @author Huji
10391040 */
10401041 $messages['fa'] = array(
@@ -1057,9 +1058,9 @@
10581059 'categorytree-no-subcategories' => 'هیچ زیررده‌ای ندارد.',
10591060 'categorytree-no-parent-categories' => 'فاقد ردهٔ بالاتر',
10601061 'categorytree-no-pages' => 'هیچ صفحه یا زیررده‌ای ندارد.',
1061 - 'categorytree-not-found' => "ردهٔ ''$1'' يافت نشد.",
 1062+ 'categorytree-not-found' => 'ردهٔ <i>$1</i> يافت نشد',
10621063 'categorytree-error' => 'اشکال در دریافت اطلاعات.',
1063 - 'categorytree-retry' => 'لطفاً چند لحظه صبر کنید و سپس دوباره امتحان کنید.',
 1064+ 'categorytree-retry' => 'لطفاً دمی درنگ کنید و باز امتحان کنید.',
10641065 );
10651066
10661067 /** Finnish (Suomi)
@@ -1867,6 +1868,7 @@
18681869 );
18691870
18701871 /** Georgian (ქართული)
 1872+ * @author BRUTE
18711873 * @author Malafaya
18721874 */
18731875 $messages['ka'] = array(
@@ -1875,10 +1877,15 @@
18761878 'categorytree-legend' => 'კატეგორიების სქემის ჩვენება',
18771879 'categorytree-category' => 'კატეგორია:',
18781880 'categorytree-go' => 'სქემის ჩვენება',
 1881+ 'categorytree-parents' => 'მშობლები',
18791882 'categorytree-mode-categories' => 'მხოლოდ კატეგორიები',
18801883 'categorytree-mode-pages' => 'გვერდები ფაილების გარდა',
18811884 'categorytree-mode-all' => 'ყველა გვერდი',
 1885+ 'categorytree-member-counts' => 'შეიცავს {{PLURAL:$1|1 ქვეკატეგორიას|$1 ქვეკატეგორიას}}, {{PLURAL:$2|1 გვერდს|$2 გვერდს}}, და {{PLURAL:$3|1 ფაილს|$3 ფაილს}}',
 1886+ 'categorytree-loading' => 'იტვირთება…',
 1887+ 'categorytree-no-subcategories' => 'ქვეკატეგორიები არ არის',
18821888 'categorytree-not-found' => 'კატეგორია <i>$1</i> არ არსებობს',
 1889+ 'categorytree-retry' => 'გთხოვთ, დაიცადეთ ცოტა ხნით და კვლავ სცადეთ.',
18831890 );
18841891
18851892 /** Kara-Kalpak (Qaraqalpaqsha)
@@ -2032,6 +2039,13 @@
20332040 'categorytree-retry' => '잠시 후에 다시 시도해주세요.',
20342041 );
20352042
 2043+/** Karachay-Balkar (Къарачай-Малкъар)
 2044+ * @author Iltever
 2045+ */
 2046+$messages['krc'] = array(
 2047+ 'categorytree-legend' => 'Категорияланы терегин кёргюз',
 2048+);
 2049+
20362050 /** Kinaray-a (Kinaray-a)
20372051 * @author Jose77
20382052 */
@@ -2039,7 +2053,7 @@
20402054 'categorytree-category' => 'Kategorya:',
20412055 );
20422056
2043 -/** Ripoarisch (Ripoarisch)
 2057+/** Colognian (Ripoarisch)
20442058 * @author Purodha
20452059 */
20462060 $messages['ksh'] = array(
@@ -2081,7 +2095,7 @@
20822096 'categorytree-not-found' => 'Kategoriya <i>$1</i> nehate dîtin',
20832097 );
20842098
2085 -/** Cornish (Kernowek)
 2099+/** Cornish (Kernewek)
20862100 * @author Kernoweger
20872101 * @author Kw-Moon
20882102 */
@@ -2134,7 +2148,7 @@
21352149 'categorytree-legend' => 'Weis Kategoriestruktur',
21362150 'categorytree-desc' => "Gadget deen op Ajax opgebaut ass fir d'[[Special:CategoryTree|Kategorie-Struktur]] vun enger Wiki duerzestellen",
21372151 'categorytree-header' => 'Gitt den Numm vun enger Kategorie an, fir hiren Inhalt als Bam-Struktur ze gesinn.
2138 -Bedenkt, datt dës Fonctioun Java Script Funktioune benotzt, déi als AJAX bekannt sinn.
 2152+Bedenkt, datt dës Fonctioun Java Script Funktioune benotzt, déi als AJAX bekannt sinn.
21392153 Wann Dir ee ganz ale Browser hutt, oder wann Dir JavaScript ausgeschalt hutt, da fonktionnéiert dëst bei Iech net.',
21402154 'categorytree-category' => 'Kategorie:',
21412155 'categorytree-go' => 'Struktur weisen',
@@ -2281,6 +2295,19 @@
22822296 'categorytree-retry' => 'Palaukite šiek tiek, ir bandykite iš naujo.',
22832297 );
22842298
 2299+/** Latgalian (Latgaļu)
 2300+ * @author Dark Eagle
 2301+ */
 2302+$messages['ltg'] = array(
 2303+ 'categorytree' => 'Kategoreju kūks',
 2304+ 'categorytree-portlet' => 'Kategorejis',
 2305+ 'categorytree-legend' => 'Paruodeit kategoreju kūku',
 2306+ 'categorytree-category' => 'Kategoreja:',
 2307+ 'categorytree-go' => 'Paruodeit kūku',
 2308+ 'categorytree-mode-categories' => 'kategorejis viņ',
 2309+ 'categorytree-mode-all' => 'vysys puslopys',
 2310+);
 2311+
22852312 /** Latvian (Latviešu)
22862313 * @author Xil
22872314 * @author Yyy
@@ -2290,8 +2317,8 @@
22912318 'categorytree-portlet' => 'Kategorijas',
22922319 'categorytree-legend' => 'Rādīt kategoriju koku',
22932320 'categorytree-desc' => "AJAX bāzēts ''gadget'', kuru lieto lai attēlotu wiki [[Special:CategoryTree|kategoriju struktūru]]",
2294 - 'categorytree-header' => 'Ievadi kategorijas nosaukumu lai apskatītos tās saturu kā koka struktūru.
2295 -Tam ir nepieciešama JavaScript (AJAX) funkcionalitāte.
 2321+ 'categorytree-header' => 'Ievadi kategorijas nosaukumu lai apskatītos tās saturu kā koka struktūru.
 2322+Tam ir nepieciešama JavaScript (AJAX) funkcionalitāte.
22962323 Ja tev ir veca interneta pārlūkprogramma, vai arī JavaScript ir atslēgts, šitas te nedarbosies.',
22972324 'categorytree-category' => 'Kategorija:',
22982325 'categorytree-go' => 'Parādīt koku',
@@ -2340,7 +2367,7 @@
23412368 'categorytree-nothing-found' => 'не е најдено ништо',
23422369 'categorytree-no-subcategories' => 'нема поткатегории',
23432370 'categorytree-no-parent-categories' => 'нема родителски категории',
2344 - 'categorytree-no-pages' => 'нема страници или поткатегории',
 2371+ 'categorytree-no-pages' => 'нема страници или подкатегории',
23452372 'categorytree-not-found' => 'Не е пронајдена категорија <i>$1</i>',
23462373 'categorytree-error' => 'Проблеми со вчитување на податоците.',
23472374 'categorytree-retry' => 'Ве молиме почекајте неколку моменти и обидетесе повторно.',
@@ -2351,17 +2378,17 @@
23522379 * @author Shijualex
23532380 */
23542381 $messages['ml'] = array(
2355 - 'categorytree' => 'വര്‍ഗ്ഗവൃക്ഷം',
 2382+ 'categorytree' => 'വർഗ്ഗവൃക്ഷം',
23562383 'categorytree-portlet' => 'വർഗ്ഗങ്ങൾ',
2357 - 'categorytree-legend' => 'വര്‍ഗ്ഗവൃക്ഷം പ്രദര്‍ശിപ്പിക്കുക',
2358 - 'categorytree-desc' => 'വിക്കിയിലെ [[Special:CategoryTree|വർഗ്ഗങ്ങളുടെ ഘടന]] പ്രദര്‍ശിപ്പിക്കുവാനുള്ള AJAX സാങ്കേതികവിദ്യ ഉപയോഗിക്കുന്ന ഗാഡ്ജറ്റ്.',
2359 - 'categorytree-header' => 'വർഗ്ഗങ്ങളുടെ ഘടന വ്യക്ഷരൂപത്തില്‍ കാണുവാന്‍ ഒരു വർഗ്ഗത്തിന്റെ പേരു ചേര്‍ക്കുക.
2360 -ഇതു പ്രവര്‍ത്തിക്കണമെങ്കില്‍ AJAX എന്ന ചുരുക്കനാമത്തിലറിയപ്പെടുന്ന അഡ്‌വാന്‍സ്‌ഡ് ജാവാസ്ക്രിപ്റ്റ് സാങ്കേതികവിദ്യ ആവശ്യമാണ്‌.
2361 -താങ്കളുടെ ബ്രൗസറില്‍ ജാവാസ്ക്രിപ്റ്റ് പ്രവര്‍ത്തനരഹിതമാക്കിയതാണെങ്കിലോ അല്ലെങ്കില്‍ ബ്രൗസര്‍ കാലഹരണപ്പെട്ടതാണെങ്കിലോ ഇതു പ്രവര്‍ത്തിക്കില്ല.',
2362 - 'categorytree-category' => 'വര്‍ഗ്ഗം:',
2363 - 'categorytree-go' => 'വൃക്ഷം പ്രദര്‍ശിപ്പിക്കുക',
 2384+ 'categorytree-legend' => 'വർഗ്ഗവൃക്ഷം പ്രദർശിപ്പിക്കുക',
 2385+ 'categorytree-desc' => 'വിക്കിയിലെ [[Special:CategoryTree|വർഗ്ഗങ്ങളുടെ ഘടന]] പ്രദർശിപ്പിക്കുവാനുള്ള AJAX സാങ്കേതികവിദ്യ ഉപയോഗിക്കുന്ന ഗാഡ്ജറ്റ്.',
 2386+ 'categorytree-header' => 'വർഗ്ഗങ്ങളുടെ ഘടന വ്യക്ഷരൂപത്തിൽ കാണുവാൻ ഒരു വർഗ്ഗത്തിന്റെ പേരു ചേർക്കുക.
 2387+ഇതു പ്രവർത്തിക്കണമെങ്കിൽ AJAX എന്ന ചുരുക്കനാമത്തിലറിയപ്പെടുന്ന അഡ്‌വാൻസ്‌ഡ് ജാവാസ്ക്രിപ്റ്റ് സാങ്കേതികവിദ്യ ആവശ്യമാണ്‌.
 2388+താങ്കളുടെ ബ്രൗസറിൽ ജാവാസ്ക്രിപ്റ്റ് പ്രവർത്തനരഹിതമാക്കിയതാണെങ്കിലോ അല്ലെങ്കിൽ ബ്രൗസർ കാലഹരണപ്പെട്ടതാണെങ്കിലോ ഇതു പ്രവർത്തിക്കില്ല.',
 2389+ 'categorytree-category' => 'വർഗ്ഗം:',
 2390+ 'categorytree-go' => 'വൃക്ഷം പ്രദർശിപ്പിക്കുക',
23642391 'categorytree-parents' => 'താവഴി',
2365 - 'categorytree-mode-categories' => 'വർഗ്ഗങ്ങള്‍ മാത്രം',
 2392+ 'categorytree-mode-categories' => 'വർഗ്ഗങ്ങൾ മാത്രം',
23662393 'categorytree-mode-pages' => 'പ്രമാണങ്ങൾ അല്ലാതെയുള്ള താളുകൾ',
23672394 'categorytree-mode-all' => 'എല്ലാ താളുകളും',
23682395 'categorytree-collapse' => 'അടയ്ക്കുക',
@@ -2373,8 +2400,8 @@
23742401 'categorytree-no-subcategories' => 'ഉപവർഗ്ഗങ്ങളില്ല',
23752402 'categorytree-no-parent-categories' => 'മാതൃവർഗ്ഗങ്ങൾ ഇല്ല',
23762403 'categorytree-no-pages' => 'താളുകളോ ഉപവർഗ്ഗങ്ങളോ ഇല്ല',
2377 - 'categorytree-not-found' => "''$1'' എന്ന വര്‍ഗ്ഗം കണ്ടില്ല",
2378 - 'categorytree-error' => 'ഡാറ്റ ലോഡ് ചെയ്യുന്നതില്‍ പിഴവ്.',
 2404+ 'categorytree-not-found' => "''$1'' എന്ന വർഗ്ഗം കണ്ടില്ല",
 2405+ 'categorytree-error' => 'ഡാറ്റ ലോഡ് ചെയ്യുന്നതിൽ പിഴവ്.',
23792406 'categorytree-retry' => 'കുറച്ചു നേരം കഴിഞ്ഞ് വീണ്ടും പരിശ്രമിക്കുക',
23802407 );
23812408
@@ -2544,8 +2571,8 @@
25452572 'categorytree-portlet' => 'Kattegerieën',
25462573 'categorytree-legend' => 'Laot kattegerieboom zien',
25472574 'categorytree-desc' => 'Dynamische navigasie veur de [[Special:CategoryTree|kattegeriestructuur]]',
2548 - 'categorytree-header' => 'Voer een kattegerienaam in um de inhoud in boomstructuur te bekieken.
2549 -NB: Veur disse functie he-j de [[JavaScript]]functionaliteit, AJAX neudig. A-j een hele ouwe webkieker hemmen, of je JavaScript uut-eschakeld hemmen, dan zal disse functie neet warken.',
 2575+ 'categorytree-header' => 'Voer een kattegerienaam in um de inhoud in boomstructuur te bekieken.
 2576+NB: Veur disse functie he-j de JavaScript-functionaliteit, AJAX neudig. A-j een hele ouwe webkieker hemmen, of je JavaScript uut-eschakeld hemmen, dan zal disse functie neet warken.',
25502577 'categorytree-category' => 'Kattegerie:',
25512578 'categorytree-go' => 'Laojen',
25522579 'categorytree-parents' => 'Ouwerkattegerieën',
@@ -2893,7 +2920,7 @@
28942921 'categorytree-desc' => "Acessório ''(gadget)'' baseado em AJAX que apresenta a [[Special:CategoryTree|estrutura]] de uma wiki",
28952922 'categorytree-header' => 'Introduza o nome de uma categoria para ver o seu conteúdo numa estrutura de árvore.
28962923 Note que isto requer uma funcionalidade avançada do JavaScript, conhecida por AJAX.
2897 -Caso o seu navegador seja razoavelmente antigo ou o JavaScript esteja desactivado, não funcionará.',
 2924+Caso o seu browser seja razoavelmente antigo ou o JavaScript esteja desactivado, não funcionará.',
28982925 'categorytree-category' => 'Categoria:',
28992926 'categorytree-go' => 'Mostrar árvore',
29002927 'categorytree-parents' => 'Categorias superiores',
@@ -2985,16 +3012,16 @@
29863013 'categorytree-portlet' => 'Categorii',
29873014 'categorytree-legend' => 'Arată arborele categoriilor',
29883015 'categorytree-desc' => 'Navighează dinamic în [[Special:CategoryTree|stuctura categoriilor]]',
2989 - 'categorytree-header' => 'Introduceţi numele categoriei pentru vizualizarea conţinutului în structură arborescentă. Notaţi faptul că această operaţie necesită funcţionalităţi JavaScript avansate cunoscute sub numele de AJAX. Dacă aveţi un browser vechi sau nu aveţi activat JavaScript, nu va funcţiona.',
 3016+ 'categorytree-header' => 'Introduceți numele categoriei pentru vizualizarea conținutului în structură arborescentă. Notați faptul că această operație necesită funcționalități JavaScript avansate cunoscute sub numele de AJAX. Dacă aveți un browser vechi sau nu aveți activat JavaScript, nu va funcționa.',
29903017 'categorytree-category' => 'Categorie:',
29913018 'categorytree-go' => 'Arată arborele',
2992 - 'categorytree-parents' => 'Părinţi',
 3019+ 'categorytree-parents' => 'Părinți',
29933020 'categorytree-mode-categories' => 'doar categorii',
29943021 'categorytree-mode-pages' => 'pagini fără imagini',
29953022 'categorytree-mode-all' => 'toate paginile',
29963023 'categorytree-collapse' => 'restrânge',
29973024 'categorytree-expand' => 'extinde',
2998 - 'categorytree-member-counts' => 'conţine {{PLURAL:$1|1 subcategorie|$1 subcategorii}}, {{PLURAL:$2|1 pagină|$2 pagini}} şi {{PLURAL:$3|1 fişier|$3 fişiere}}',
 3025+ 'categorytree-member-counts' => 'conține {{PLURAL:$1|1 subcategorie|$1 subcategorii}}, {{PLURAL:$2|1 pagină|$2 pagini}} și {{PLURAL:$3|1 fișier|$3 fișiere}}',
29993026 'categorytree-load' => 'încarcă',
30003027 'categorytree-loading' => 'încărcare…',
30013028 'categorytree-nothing-found' => 'fără subcategorii',
@@ -3003,7 +3030,7 @@
30043031 'categorytree-no-pages' => 'nici o pagină sau subcategorie',
30053032 'categorytree-not-found' => 'Categoria <i>$1</i> nu a fost găsită',
30063033 'categorytree-error' => 'Problemă la încărcarea datelor',
3007 - 'categorytree-retry' => 'Vă rugăm să aşteptaţi câteva momente şi să încercaţi din nou.',
 3034+ 'categorytree-retry' => 'Vă rugăm să așteptați câteva momente și să încercați din nou.',
30083035 );
30093036
30103037 /** Tarandíne (Tarandíne)
@@ -3226,6 +3253,7 @@
32273254 );
32283255
32293256 /** Slovenian (Slovenščina)
 3257+ * @author Dbc334
32303258 * @author Freakolowsky
32313259 * @author editors of sl.wikipedia
32323260 */
@@ -3234,7 +3262,7 @@
32353263 'categorytree-portlet' => 'Kategorije',
32363264 'categorytree-legend' => 'Prikaži drevo kategorij',
32373265 'categorytree-desc' => 'Dinamično navigiraj po [[Special:CategoryTree|strukturi kategorij]]',
3238 - 'categorytree-header' => 'Vnesite ime kategorije, katere vsebino želite videti kot drevesno strukturo. Upoštevajte, da je za to potreben AJAX, poseben nacin za delovanje JavaScripta. Ce je vaš brskalnik zelo star oziroma je JavaScript v njem onemogocen, drevo kategorij ne bo prikazano.',
 3266+ 'categorytree-header' => 'Vnesite ime kategorije, katere vsebino želite videti kot drevesno strukturo. Upoštevajte, da je za to potreben Ajax, poseben način za delovanje JavaScripta. Ce je vaš brskalnik zelo star oziroma je JavaScript v njem onemogocen, drevo kategorij ne bo prikazano.',
32393267 'categorytree-category' => 'Kategorija',
32403268 'categorytree-go' => 'Pokaži drevo',
32413269 'categorytree-parents' => 'Starši',
@@ -3243,15 +3271,15 @@
32443272 'categorytree-mode-all' => 'vse strani',
32453273 'categorytree-collapse' => 'skrci',
32463274 'categorytree-expand' => 'razširi',
3247 - 'categorytree-member-counts' => 'vsebuje {{PLURAL:$1|1 podkategorijo|2 podkategoriji|$1 podkategorije|$1 podkategorij}} {{PLURAL:$2|1 stran|2 strani|$2 strani}} in {{PLURAL:$3|1 datoteka|2 datoteki|$3 datoteke|$3 datotek}}',
 3275+ 'categorytree-member-counts' => 'vsebuje $1 {{PLURAL:$1|podkategorijo|podkategoriji|podkategorije|podkategorij}}, $2 {{PLURAL:$2|stran|strani|strani}} in $3 {{PLURAL:$3|datoteko|datoteki|datoteke|datotek}}',
32483276 'categorytree-load' => 'naloži',
32493277 'categorytree-loading' => 'nalagam',
32503278 'categorytree-nothing-found' => 'ni zadetkov',
32513279 'categorytree-no-subcategories' => 'ni podkategorij',
3252 - 'categorytree-no-parent-categories' => 'ni matičnih kategorij',
 3280+ 'categorytree-no-parent-categories' => 'ni starševskih kategorij',
32533281 'categorytree-no-pages' => 'ni strani ali podkategorij',
3254 - 'categorytree-not-found' => 'Kategorije <i>$1</i> ni moc najti',
3255 - 'categorytree-error' => 'Problem pri nalaganju podatkov',
 3282+ 'categorytree-not-found' => 'Kategorije <i>$1</i> ni moč najti',
 3283+ 'categorytree-error' => 'Težava pri nalaganju podatkov.',
32563284 'categorytree-retry' => 'Prosimo, počakajte trenutek in poskusite znova.',
32573285 );
32583286
@@ -3642,8 +3670,8 @@
36433671 'categorytree-portlet' => 'Kategoriýalar',
36443672 'categorytree-legend' => 'Kategoriýa agajyny görkez',
36453673 'categorytree-desc' => '[[Special:CategoryTree|Kategoriýa gurluşyny]] dinamik ýagdaýda dolandyr',
3646 - 'categorytree-header' => 'Kategoriýanyň adyny ýazyp, onuň mazmunyny agaç gurluşy hökmünde görüp bilersiňiz.
3647 -Bu aýratynlyk AJAX ady bilen tanalýan ösen JavaScript bilen işleýändir.
 3674+ 'categorytree-header' => 'Kategoriýanyň adyny ýazyp, onuň mazmunyny agaç gurluşy hökmünde görüp bilersiňiz.
 3675+Bu aýratynlyk AJAX ady bilen tanalýan ösen JavaScript bilen işleýändir.
36483676 Eger brauzeriňiz köne bolsa ýa-da JavaScript ýapyk bolsa, onda ol işlemez.',
36493677 'categorytree-category' => 'Kategoriýa:',
36503678 'categorytree-go' => 'Agajy görkez',
@@ -3933,8 +3961,8 @@
39343962 'categorytree' => 'קאַטעגאריע בוים',
39353963 'categorytree-portlet' => 'קאַטעגאריעס',
39363964 'categorytree-legend' => 'ווײַזן קאַטעגאריע בוים',
3937 - 'categorytree-header' => 'לייגט אריין א קאטעגאריע נאמען צו זען איר אינהאלט אלס א בוים סטרוקטור.
3938 -באמערקט אז דאס פארלאנגט פארגעשריטענע JavaScript מעגליכקייטן, באקאנט אלס AJAX.
 3965+ 'categorytree-header' => 'לייגט אריין א קאטעגאריע נאמען צו זען איר אינהאלט אלס א בוים סטרוקטור.
 3966+באמערקט אז דאס פארלאנגט פארגעשריטענע JavaScript מעגליכקייטן, באקאנט אלס AJAX.
39393967 אויב איר ניצט אן אלטן בלעטערער, אדער איר ערלויבט נישט קיין JavaScript, וועט דאס נישט ווירקן.',
39403968 'categorytree-category' => 'קאטעגאריע:',
39413969 'categorytree-go' => 'ווײַזן בוים',
@@ -3954,7 +3982,17 @@
39553983 'categorytree-retry' => 'ביטע וואַרט אַ רגע און פרובירט נאכאַמאָל',
39563984 );
39573985
3958 -/** Yue (粵語)
 3986+/** Yoruba (Yorùbá)
 3987+ * @author Demmy
 3988+ */
 3989+$messages['yo'] = array(
 3990+ 'categorytree-portlet' => 'Àwọn ẹ̀ka',
 3991+ 'categorytree-category' => 'Ẹ̀ka:',
 3992+ 'categorytree-parents' => 'Àwọn òbí',
 3993+ 'categorytree-mode-all' => 'gbogbo àwọn ojúewé',
 3994+);
 3995+
 3996+/** Cantonese (粵語)
39593997 * @author Shinjiman
39603998 */
39613999 $messages['yue'] = array(
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 /**
54 * Setup and Hooks for the CategoryTree extension, an AJAX based gadget
65 * to display the category structure of a wiki
@@ -10,7 +9,7 @@
1110 * @license GNU General Public Licence 2.0 or later
1211 */
1312
14 -if( !defined( 'MEDIAWIKI' ) ) {
 13+if ( !defined( 'MEDIAWIKI' ) ) {
1514 echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
1615 die( 1 );
1716 }
@@ -19,24 +18,25 @@
2019 * Constants for use with the mode,
2120 * defining what should be shown in the tree
2221 */
23 -define('CT_MODE_CATEGORIES', 0);
24 -define('CT_MODE_PAGES', 10);
25 -define('CT_MODE_ALL', 20);
26 -define('CT_MODE_PARENTS', 100);
 22+define( 'CT_MODE_CATEGORIES', 0 );
 23+define( 'CT_MODE_PAGES', 10 );
 24+define( 'CT_MODE_ALL', 20 );
 25+define( 'CT_MODE_PARENTS', 100 );
2726
2827 /**
2928 * Constants for use with the hideprefix option,
3029 * defining when the namespace prefix should be hidden
3130 */
32 -define('CT_HIDEPREFIX_NEVER', 0);
33 -define('CT_HIDEPREFIX_ALWAYS', 10);
34 -define('CT_HIDEPREFIX_CATEGORIES', 20);
35 -define('CT_HIDEPREFIX_AUTO', 30);
 31+define( 'CT_HIDEPREFIX_NEVER', 0 );
 32+define( 'CT_HIDEPREFIX_ALWAYS', 10 );
 33+define( 'CT_HIDEPREFIX_CATEGORIES', 20 );
 34+define( 'CT_HIDEPREFIX_AUTO', 30 );
3635
3736 /**
3837 * Options:
3938 *
4039 * $wgCategoryTreeMaxChildren - maximum number of children shown in a tree node. Default is 200
 40+ * $wgCategoryTreeMaxScanRows - maximum number of rows the DBMS may scan while showing a tree node.
4141 * $wgCategoryTreeAllowTag - enable <categorytree> tag. Default is true.
4242 * $wgCategoryTreeDynamicTag - loads the first level of the tree in a <categorytag> dynamically.
4343 * This way, the cache does not need to be disabled. Default is false.
@@ -52,57 +52,58 @@
5353 */
5454
5555 $wgCategoryTreeMaxChildren = 200;
 56+$wgCategoryTreeMaxScanRows = 10000;
5657 $wgCategoryTreeAllowTag = true;
5758 $wgCategoryTreeDisableCache = true;
5859 $wgCategoryTreeDynamicTag = false;
5960 $wgCategoryTreeHTTPCache = false;
60 -#$wgCategoryTreeUnifiedView = true;
61 -$wgCategoryTreeMaxDepth = array(CT_MODE_PAGES => 1, CT_MODE_ALL => 1, CT_MODE_CATEGORIES => 2);
 61+# $wgCategoryTreeUnifiedView = true;
 62+$wgCategoryTreeMaxDepth = array( CT_MODE_PAGES => 1, CT_MODE_ALL => 1, CT_MODE_CATEGORIES => 2 );
6263
63 -# Set $wgCategoryTreeForceHeaders to true to force the JS and CSS headers for CategoryTree to be included on every page.
 64+# Set $wgCategoryTreeForceHeaders to true to force the JS and CSS headers for CategoryTree to be included on every page.
6465 # May be usefull for using CategoryTree from within system messages, in the sidebar, or a custom skin.
65 -$wgCategoryTreeForceHeaders = false;
 66+$wgCategoryTreeForceHeaders = false;
6667 $wgCategoryTreeSidebarRoot = null;
6768 $wgCategoryTreeHijackPageCategories = false; # EXPERIMENTAL! NOT YET FOR PRODUCTION USE! Main problem is general HTML/CSS layout cruftiness.
6869
6970 $wgCategoryTreeExtPath = '/extensions/CategoryTree';
70 -$wgCategoryTreeVersion = '5'; #NOTE: bump this when you change the CSS or JS files!
 71+$wgCategoryTreeVersion = '6'; # NOTE: bump this when you change the CSS or JS files!
7172 $wgCategoryTreeUseCategoryTable = version_compare( $wgVersion, "1.13", '>=' );
7273
7374 $wgCategoryTreeOmitNamespace = CT_HIDEPREFIX_CATEGORIES;
7475 $wgCategoryTreeDefaultMode = CT_MODE_CATEGORIES;
75 -$wgCategoryTreeDefaultOptions = array(); #Default values for most options. ADD NEW OPTIONS HERE!
 76+$wgCategoryTreeDefaultOptions = array(); # Default values for most options. ADD NEW OPTIONS HERE!
7677 $wgCategoryTreeDefaultOptions['mode'] = null; # will be set to $wgCategoryTreeDefaultMode in efCategoryTree(); compatibility quirk
7778 $wgCategoryTreeDefaultOptions['hideprefix'] = null; # will be set to $wgCategoryTreeDefaultMode in efCategoryTree(); compatibility quirk
7879 $wgCategoryTreeDefaultOptions['showcount'] = false;
7980 $wgCategoryTreeDefaultOptions['namespaces'] = false; # false means "no filter"
8081
8182 $wgCategoryTreeCategoryPageMode = CT_MODE_CATEGORIES;
82 -$wgCategoryTreeCategoryPageOptions = array(); #Options to be used for category pages
 83+$wgCategoryTreeCategoryPageOptions = array(); # Options to be used for category pages
8384 $wgCategoryTreeCategoryPageOptions['mode'] = NULL; # will be set to $wgCategoryTreeDefaultMode in efCategoryTree(); compatibility quirk
8485 $wgCategoryTreeCategoryPageOptions['showcount'] = true;
8586
86 -$wgCategoryTreeSpecialPageOptions = array(); #Options to be used for Special:CategoryTree
 87+$wgCategoryTreeSpecialPageOptions = array(); # Options to be used for Special:CategoryTree
8788 $wgCategoryTreeSpecialPageOptions['showcount'] = true;
8889
89 -$wgCategoryTreeSidebarOptions = array(); #Options to be used in the sidebar (for use with $wgCategoryTreeSidebarRoot)
 90+$wgCategoryTreeSidebarOptions = array(); # Options to be used in the sidebar (for use with $wgCategoryTreeSidebarRoot)
9091 $wgCategoryTreeSidebarOptions['mode'] = CT_MODE_CATEGORIES;
9192 $wgCategoryTreeSidebarOptions['hideprefix'] = CT_HIDEPREFIX_CATEGORIES;
9293 $wgCategoryTreeSidebarOptions['showcount'] = false;
9394 $wgCategoryTreeSidebarOptions['hideroot'] = true;
94 -$wgCategoryTreeSidebarOptions['namespaces'] = false;
 95+$wgCategoryTreeSidebarOptions['namespaces'] = false;
9596 $wgCategoryTreeSidebarOptions['depth'] = 1;
9697
97 -$wgCategoryTreePageCategoryOptions = array(); #Options to be used in the sidebar (for use with $wgCategoryTreePageCategories)
 98+$wgCategoryTreePageCategoryOptions = array(); # Options to be used in the sidebar (for use with $wgCategoryTreePageCategories)
9899 $wgCategoryTreePageCategoryOptions['mode'] = CT_MODE_PARENTS;
99100 $wgCategoryTreePageCategoryOptions['hideprefix'] = CT_HIDEPREFIX_CATEGORIES;
100101 $wgCategoryTreePageCategoryOptions['showcount'] = false;
101102 $wgCategoryTreePageCategoryOptions['hideroot'] = false;
102103 $wgCategoryTreePageCategoryOptions['namespaces'] = false;
103104 $wgCategoryTreePageCategoryOptions['depth'] = 0;
104 -#$wgCategoryTreePageCategoryOptions['class'] = 'CategoryTreeInlineNode';
 105+# $wgCategoryTreePageCategoryOptions['class'] = 'CategoryTreeInlineNode';
105106
106 -$wgExtensionAliasesFiles['CategoryTree'] = dirname(__FILE__) . '/CategoryTree.alias.php';
 107+$wgExtensionAliasesFiles['CategoryTree'] = dirname( __FILE__ ) . '/CategoryTree.alias.php';
107108
108109 /**
109110 * Register extension setup hook and credits
@@ -113,7 +114,6 @@
114115 'name' => 'CategoryTree',
115116 'author' => 'Daniel Kinzler',
116117 'url' => 'http://www.mediawiki.org/wiki/Extension:CategoryTree',
117 - 'description' => 'Dynamically navigate the category structure',
118118 'descriptionmsg' => 'categorytree-desc',
119119 );
120120 $wgExtensionCredits['parserhook'][] = array(
@@ -128,7 +128,7 @@
129129 /**
130130 * Register the special page
131131 */
132 -$dir = dirname(__FILE__) . '/';
 132+$dir = dirname( __FILE__ ) . '/';
133133
134134 if ( $wgUseAjax && $wgCategoryTreeAllowTag ) {
135135 $wgExtensionMessagesFiles['CategoryTreeMagic'] = $dir . 'CategoryTree.i18n.magic.php';
@@ -140,7 +140,7 @@
141141 $wgAutoloadClasses['CategoryTreeCategoryPage'] = $dir . 'CategoryPageSubclass.php';
142142 $wgSpecialPages['CategoryTree'] = 'CategoryTreePage';
143143 $wgSpecialPageGroups['CategoryTree'] = 'pages';
144 -#$wgHooks['SkinTemplateTabs'][] = 'efCategoryTreeInstallTabs';
 144+# $wgHooks['SkinTemplateTabs'][] = 'efCategoryTreeInstallTabs';
145145 $wgHooks['ArticleFromTitle'][] = 'efCategoryTreeArticleFromTitle';
146146
147147 /**
@@ -174,7 +174,7 @@
175175 $wgHooks['SkinJoinCategoryLinks'][] = 'efCategoryTreeSkinJoinCategoryLinks';
176176 }
177177
178 - if( $wgCategoryTreeAllowTag ) {
 178+ if ( $wgCategoryTreeAllowTag ) {
179179 $wgHooks['ParserFirstCallInit'][] = 'efCategoryTreeSetHooks';
180180 }
181181
@@ -221,13 +221,13 @@
222222 $depth = isset( $options['depth'] ) ? (int)$options['depth'] : 1;
223223
224224 $ct = new CategoryTree( $options, true );
225 - $depth = efCategoryTreeCapDepth( $ct->getOption('mode'), $depth );
 225+ $depth = efCategoryTreeCapDepth( $ct->getOption( 'mode' ), $depth );
226226 $response = $ct->ajax( $category, $depth );
227227
228228 if ( $wgCategoryTreeHTTPCache && $wgSquidMaxage && $wgUseSquid ) {
229229 $response->setCacheDuration( $wgSquidMaxage );
230 - $response->setVary( 'Accept-Encoding, Cookie' ); #cache for anons only
231 - #TODO: purge the squid cache when a category page is invalidated
 230+ $response->setVary( 'Accept-Encoding, Cookie' ); # cache for anons only
 231+ # TODO: purge the squid cache when a category page is invalidated
232232 }
233233
234234 return $response;
@@ -240,20 +240,22 @@
241241 function efCategoryTreeCapDepth( $mode, $depth ) {
242242 global $wgCategoryTreeMaxDepth;
243243
244 - if (is_numeric($depth))
245 - $depth = intval($depth);
246 - else return 1;
 244+ if ( is_numeric( $depth ) ) {
 245+ $depth = intval( $depth );
 246+ } else {
 247+ return 1;
 248+ }
247249
248 - if (is_array($wgCategoryTreeMaxDepth)) {
249 - $max = isset($wgCategoryTreeMaxDepth[$mode]) ? $wgCategoryTreeMaxDepth[$mode] : 1;
250 - } elseif (is_numeric($wgCategoryTreeMaxDepth)) {
 250+ if ( is_array( $wgCategoryTreeMaxDepth ) ) {
 251+ $max = isset( $wgCategoryTreeMaxDepth[$mode] ) ? $wgCategoryTreeMaxDepth[$mode] : 1;
 252+ } elseif ( is_numeric( $wgCategoryTreeMaxDepth ) ) {
251253 $max = $wgCategoryTreeMaxDepth;
252254 } else {
253255 wfDebug( 'efCategoryTreeCapDepth: $wgCategoryTreeMaxDepth is invalid.' );
254256 $max = 1;
255257 }
256258
257 - return min($depth, $max);
 259+ return min( $depth, $max );
258260 }
259261
260262 /**
@@ -262,28 +264,30 @@
263265 */
264266 function efCategoryTreeParserFunction( &$parser ) {
265267 $params = func_get_args();
266 - array_shift( $params ); //first is &$parser, strip it
 268+ array_shift( $params ); // first is &$parser, strip it
267269
268 - //first user-supplied parameter must be category name
269 - if ( !$params ) return ''; //no category specified, return nothing
 270+ // first user-supplied parameter must be category name
 271+ if ( !$params ) {
 272+ return ''; // no category specified, return nothing
 273+ }
270274 $cat = array_shift( $params );
271275
272 - //build associative arguments from flat parameter list
 276+ // build associative arguments from flat parameter list
273277 $argv = array();
274278 foreach ( $params as $p ) {
275 - if ( preg_match('/^\s*(\S.*?)\s*=\s*(.*?)\s*$/', $p, $m) ) {
 279+ if ( preg_match( '/^\s*(\S.*?)\s*=\s*(.*?)\s*$/', $p, $m ) ) {
276280 $k = $m[1];
277 - $v = preg_replace('/^"\s*(.*?)\s*"$/', '$1', $m[2]); //strip any quotes enclusing the value
 281+ $v = preg_replace( '/^"\s*(.*?)\s*"$/', '$1', $m[2] ); // strip any quotes enclusing the value
278282 }
279283 else {
280 - $k = trim($p);
 284+ $k = trim( $p );
281285 $v = true;
282286 }
283287
284288 $argv[$k] = $v;
285289 }
286290
287 - //now handle just like a <categorytree> tag
 291+ // now handle just like a <categorytree> tag
288292 $html = efCategoryTreeParserHook( $cat, $argv, $parser );
289293 return array( $html, 'noparse' => true, 'isHTML' => true );
290294 }
@@ -294,14 +298,15 @@
295299 */
296300 function efCategoryTreeSkinTemplateOutputPageBeforeExec( &$skin, &$tpl ) {
297301 global $wgCategoryTreeSidebarRoot, $wgCategoryTreeSidebarOptions;
298 -
 302+
299303 $html = efCategoryTreeParserHook( $wgCategoryTreeSidebarRoot, $wgCategoryTreeSidebarOptions );
300 - if ( $html ) $tpl->data['sidebar']['categorytree-portlet'] = $html; //requires MW 1.13, r36917
 304+ if ( $html ) {
 305+ $tpl->data['sidebar']['categorytree-portlet'] = $html; // requires MW 1.13, r36917
 306+ }
301307
302308 return true;
303309 }
304310
305 -
306311 /**
307312 * Entry point for the <categorytree> tag parser hook.
308313 * This loads CategoryTreeFunctions.php and calls CategoryTree::getTag()
@@ -311,8 +316,7 @@
312317
313318 if ( $parser ) {
314319 $parser->mOutput->mCategoryTreeTag = true; # flag for use by efCategoryTreeParserOutput
315 - }
316 - else {
 320+ } else {
317321 CategoryTree::setHeaders( $wgOut );
318322 }
319323
@@ -325,7 +329,9 @@
326330 $depthArg = isset( $argv[ 'depth' ] ) ? (int)$argv[ 'depth' ] : null;
327331
328332 $depth = efCategoryTreeCapDepth( $ct->getOption( 'mode' ), $depthArg );
329 - if ( $onlyroot ) $depth = 0;
 333+ if ( $onlyroot ) {
 334+ $depth = 0;
 335+ }
330336
331337 return $ct->getTag( $parser, $cat, $hideroot, $attr, $depth, $allowMissing );
332338 }
@@ -366,13 +372,11 @@
367373 return false;
368374 }
369375
370 -
371376 function efCategoryTreeSkinJoinCategoryLinks( &$skin, &$links, &$result ) {
372377 $embed = '<div class="CategoryTreePretendInlineMSIE CategoryTreeCategoryBarItem">';
373378 $pop = '</div>';
374379 $sep = ' ';
375380
376 -# $result = '<div class="CategoryTreeCatBarWrapper" style="border:1px solid blue">' . $embed . implode ( "{$pop} {$sep} {$embed}" , $links ) . $pop . '</div>';
377381 $result = $embed . implode ( "{$pop} {$sep} {$embed}" , $links ) . $pop;
378382
379383 return false;
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.css
@@ -8,7 +8,7 @@
99 * @copyright © 2006 Daniel Kinzler
1010 * @licence GNU General Public Licence 2.0 or later
1111 *
12 - * NOTE: if you change this, increment $wgCategoryTreeVersion
 12+ * NOTE: if you change this, increment $wgCategoryTreeVersion
1313 * in CategoryTree.php to avoid users getting stale copies from cache.
1414 */
1515
@@ -21,6 +21,9 @@
2222 cursor: pointer;
2323 cursor: hand; /* hack for MSIE 5.0 and 5.5 */
2424 }
 25+.CategoryTreeEmptyBullet {
 26+ cursor: default;
 27+}
2528
2629 .CategoryTreeBullet a,
2730 .CategoryTreeBullet a:link,
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.js
@@ -8,155 +8,155 @@
99 * @copyright © 2006 Daniel Kinzler
1010 * @licence GNU General Public Licence 2.0 or later
1111 *
12 - * NOTE: if you change this, increment $wgCategoryTreeVersion
 12+ * NOTE: if you change this, increment $wgCategoryTreeVersion
1313 * in CategoryTree.php to avoid users getting stale copies from cache.
14 -*/
 14+ */
1515
1616 // Default messages if new code loaded with old cached page
1717 var categoryTreeErrorMsg = "Problem loading data.";
1818 var categoryTreeRetryMsg = "Please wait a moment and try again.";
1919
20 - function categoryTreeNextDiv(e) {
21 - var n= e.nextSibling;
22 - while ( n && ( n.nodeType != 1 || n.nodeName != 'DIV') ) {
23 - //alert('nodeType: ' + n.nodeType + '; nodeName: ' + n.nodeName);
24 - n= n.nextSibling;
25 - }
 20+function categoryTreeNextDiv(e) {
 21+ var n= e.nextSibling;
 22+ while ( n && ( n.nodeType != 1 || n.nodeName != 'DIV') ) {
 23+ //alert('nodeType: ' + n.nodeType + '; nodeName: ' + n.nodeName);
 24+ n= n.nextSibling;
 25+ }
2626
27 - return n;
28 - }
 27+ return n;
 28+}
2929
30 - function categoryTreeExpandNode(cat, options, lnk) {
31 - var div= categoryTreeNextDiv( lnk.parentNode.parentNode );
 30+function categoryTreeExpandNode(cat, options, lnk) {
 31+ var div= categoryTreeNextDiv( lnk.parentNode.parentNode );
3232
33 - div.style.display= 'block';
34 - lnk.innerHTML= categoryTreeCollapseBulletMsg;
35 - lnk.title= categoryTreeCollapseMsg;
36 - lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }
 33+ div.style.display= 'block';
 34+ lnk.innerHTML= categoryTreeCollapseBulletMsg;
 35+ lnk.title= categoryTreeCollapseMsg;
 36+ lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }
3737
38 - if (!lnk.className.match(/(^| )CategoryTreeLoaded($| )/)) {
39 - categoryTreeLoadNode(cat, options, lnk, div);
40 - }
41 - }
 38+ if (!lnk.className.match(/(^| )CategoryTreeLoaded($| )/)) {
 39+ categoryTreeLoadNode(cat, options, lnk, div);
 40+ }
 41+}
4242
43 - function categoryTreeCollapseNode(cat, options, lnk) {
44 - var div= categoryTreeNextDiv( lnk.parentNode.parentNode );
 43+function categoryTreeCollapseNode(cat, options, lnk) {
 44+ var div= categoryTreeNextDiv( lnk.parentNode.parentNode );
4545
46 - div.style.display= 'none';
47 - lnk.innerHTML= categoryTreeExpandBulletMsg;
48 - lnk.title= categoryTreeExpandMsg;
49 - lnk.onclick= function() { categoryTreeExpandNode(cat, options, lnk) }
50 - }
 46+ div.style.display= 'none';
 47+ lnk.innerHTML= categoryTreeExpandBulletMsg;
 48+ lnk.title= categoryTreeExpandMsg;
 49+ lnk.onclick= function() { categoryTreeExpandNode(cat, options, lnk) }
 50+}
5151
52 - function categoryTreeLoadNode(cat, options, lnk, div) {
53 - div.style.display= 'block';
54 - lnk.className= 'CategoryTreeLoaded';
55 - lnk.innerHTML= categoryTreeCollapseBulletMsg;
56 - lnk.title= categoryTreeCollapseMsg;
57 - lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }
 52+function categoryTreeLoadNode(cat, options, lnk, div) {
 53+ div.style.display= 'block';
 54+ lnk.className= 'CategoryTreeLoaded';
 55+ lnk.innerHTML= categoryTreeCollapseBulletMsg;
 56+ lnk.title= categoryTreeCollapseMsg;
 57+ lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }
5858
59 - categoryTreeLoadChildren(cat, options, div)
60 - }
 59+ categoryTreeLoadChildren(cat, options, div)
 60+}
6161
62 - // FIXME Why can't this just use uneval()?
63 - function categoryTreeEncodeValue(value) {
64 - switch (typeof value) {
65 - case 'function':
66 - throw new Error("categoryTreeEncodeValue encountered a function");
67 - break;
 62+// FIXME Why can't this just use uneval()?
 63+function categoryTreeEncodeValue(value) {
 64+ switch (typeof value) {
 65+ case 'function':
 66+ throw new Error("categoryTreeEncodeValue encountered a function");
 67+ break;
 68+ case 'string':
 69+ s = '"' + value.replace(/([\\"'])/g, "\\$1") + '"';
 70+ break;
 71+ case 'number':
 72+ case 'boolean':
 73+ case 'null':
 74+ s = String(value);
 75+ break;
 76+ case 'object':
 77+ if ( !value ) {
 78+ s = 'null';
 79+ } else if (typeof value.length === 'number' && !(value.propertyIsEnumerable('length'))) {
 80+ s = '';
 81+ for (i = 0; i<value.length; i++) {
 82+ v = value[i];
 83+ if ( s!='' ) s += ', ';
 84+ s += categoryTreeEncodeValue( v );
 85+ }
 86+ s = '[' + s + ']';
 87+ } else {
 88+ s = '';
 89+ for (k in value) {
 90+ v = value[k];
 91+ if ( s!='' ) s += ', ';
 92+ s += categoryTreeEncodeValue( k );
 93+ s += ': ';
 94+ s += categoryTreeEncodeValue( v );
 95+ }
 96+ s = '{' + s + '}';
 97+ }
 98+ break;
 99+ default:
 100+ throw new Error("categoryTreeEncodeValue encountered strange variable type " + (typeof value));
 101+ }
68102
69 - case 'string':
70 - s = '"' + value.replace(/([\\"'])/g, "\\$1") + '"';
71 - break;
 103+ return s;
 104+}
72105
73 - case 'number':
74 - case 'boolean':
75 - case 'null':
76 - s = String(value);
77 - break;
 106+function categoryTreeLoadChildren(cat, options, div) {
 107+ div.innerHTML= '<i class="CategoryTreeNotice">' + categoryTreeLoadingMsg + '</i>';
78108
79 - case 'object':
80 - if ( !value ) {
81 - s = 'null';
82 - }
83 - else if (typeof value.length === 'number' && !(value.propertyIsEnumerable('length'))) {
84 - s = '';
85 - for (i = 0; i<value.length; i++) {
86 - v = value[i];
87 - if ( s!='' ) s += ', ';
88 - s += categoryTreeEncodeValue( v );
89 - }
90 - s = '[' + s + ']';
91 - }
92 - else {
93 - s = '';
94 - for (k in value) {
95 - v = value[k];
96 - if ( s!='' ) s += ', ';
97 - s += categoryTreeEncodeValue( k );
98 - s += ': ';
99 - s += categoryTreeEncodeValue( v );
100 - }
101 - s = '{' + s + '}';
102 - }
103 - break;
104 - default:
105 - throw new Error("categoryTreeEncodeValue encountered strange variable type " + (typeof value));
106 - }
 109+ if ( typeof options == "string" ) { //hack for backward compatibility
 110+ options = { mode : options };
 111+ }
107112
108 - return s;
109 - }
 113+ function f( request ) {
 114+ if (request.status != 200) {
 115+ div.innerHTML = '<i class="CategoryTreeNotice">' + categoryTreeErrorMsg + ' </i>';
 116+ var retryLink = document.createElement('a');
 117+ retryLink.innerHTML = categoryTreeRetryMsg;
 118+ retryLink.onclick = function() {
 119+ categoryTreeLoadChildren(cat, options, div, enc);
 120+ }
 121+ div.appendChild(retryLink);
 122+ return;
 123+ }
110124
111 - function categoryTreeLoadChildren(cat, options, div) {
112 - div.innerHTML= '<i class="CategoryTreeNotice">' + categoryTreeLoadingMsg + '</i>';
 125+ result= request.responseText;
 126+ result= result.replace(/^\s+|\s+$/, '');
113127
114 - if ( typeof options == "string" ) { //hack for backward compatibility
115 - options = { mode : options };
116 - }
 128+ if ( result == '' ) {
 129+ result= '<i class="CategoryTreeNotice">';
117130
118 - function f( request ) {
119 - if (request.status != 200) {
120 - div.innerHTML = '<i class="CategoryTreeNotice">' + categoryTreeErrorMsg + ' </i>';
121 - var retryLink = document.createElement('a');
122 - retryLink.innerHTML = categoryTreeRetryMsg;
123 - retryLink.onclick = function() {
124 - categoryTreeLoadChildren(cat, options, div, enc);
125 - }
126 - div.appendChild(retryLink);
127 - return;
128 - }
 131+ if ( options.mode == 0 ) {
 132+ result= categoryTreeNoSubcategoriesMsg;
 133+ } else if ( options.mode == 10 ) {
 134+ result= categoryTreeNoPagesMsg;
 135+ } else if ( options.mode == 100 ) {
 136+ result= categoryTreeNoParentCategoriesMsg;
 137+ } else {
 138+ result= categoryTreeNothingFoundMsg;
 139+ }
129140
130 - result= request.responseText;
131 - result= result.replace(/^\s+|\s+$/, '');
 141+ result+= '</i>';
 142+ }
132143
133 - if ( result == '' ) {
134 - result= '<i class="CategoryTreeNotice">';
 144+ result = result.replace(/##LOAD##/g, categoryTreeExpandMsg);
 145+ div.innerHTML= result;
135146
136 - if ( options.mode == 0 ) result= categoryTreeNoSubcategoriesMsg;
137 - else if ( options.mode == 10 ) result= categoryTreeNoPagesMsg;
138 - else if ( options.mode == 100 ) result= categoryTreeNoParentCategoriesMsg;
139 - else result= categoryTreeNothingFoundMsg;
 147+ categoryTreeShowToggles();
 148+ }
140149
141 - result+= '</i>';
142 - }
 150+ var opt = categoryTreeEncodeValue(options);
 151+ sajax_do_call( "efCategoryTreeAjaxWrapper", [cat, opt, 'json'] , f );
 152+}
143153
144 - result = result.replace(/##LOAD##/g, categoryTreeExpandMsg);
145 - div.innerHTML= result;
 154+function categoryTreeShowToggles() {
 155+ var toggles = getElementsByClassName( document, 'span', 'CategoryTreeToggle' );
146156
147 - categoryTreeShowToggles();
148 - }
 157+ for( var i = 0; i<toggles.length; ++i ) {
 158+ toggles[i].style.display = 'inline';
 159+ }
 160+}
149161
150 - var opt = categoryTreeEncodeValue(options);
151 - sajax_do_call( "efCategoryTreeAjaxWrapper", [cat, opt, 'json'] , f );
152 - }
153 -
154 - function categoryTreeShowToggles() {
155 - var toggles = getElementsByClassName( document, 'span', 'CategoryTreeToggle' );
156 -
157 - for( var i = 0; i<toggles.length; ++i ) {
158 - toggles[i].style.display = 'inline';
159 - }
160 - }
161 -
162 - // Re-show the CategoryTreeToggles
163 - addOnloadHook(categoryTreeShowToggles);
 162+// Re-show the CategoryTreeToggles
 163+addOnloadHook(categoryTreeShowToggles);
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTree.alias.php
@@ -192,7 +192,7 @@
193193 'CategoryTree' => array( '분류트리' ),
194194 );
195195
196 -/** Ripoarisch (Ripoarisch) */
 196+/** Colognian (Ripoarisch) */
197197 $aliases['ksh'] = array(
198198 'CategoryTree' => array( 'Saachjruppeboum' ),
199199 );
@@ -214,7 +214,7 @@
215215
216216 /** Malayalam (മലയാളം) */
217217 $aliases['ml'] = array(
218 - 'CategoryTree' => array( 'വര്‍ഗ്ഗവൃക്ഷം' ),
 218+ 'CategoryTree' => array( 'വർഗ്ഗവൃക്ഷം' ),
219219 );
220220
221221 /** Marathi (मराठी) */
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 /**
54 * Core functions for the CategoryTree extension, an AJAX based gadget
65 * to display the category structure of a wiki
@@ -10,7 +9,7 @@
1110 * @license GNU General Public Licence 2.0 or later
1211 */
1312
14 -if( !defined( 'MEDIAWIKI' ) ) {
 13+if ( !defined( 'MEDIAWIKI' ) ) {
1514 echo( "This file is part of an extension to the MediaWiki software and cannot be used standalone.\n" );
1615 die( 1 );
1716 }
@@ -24,16 +23,19 @@
2524
2625 $this->mIsAjaxRequest = $ajax;
2726
28 - #ensure default values and order of options. Order may become important, it may influence the cache key!
 27+ # ensure default values and order of options. Order may become important, it may influence the cache key!
2928 foreach ( $wgCategoryTreeDefaultOptions as $option => $default ) {
30 - if ( isset( $options[$option] ) && !is_null( $options[$option] ) ) $this->mOptions[$option] = $options[$option];
31 - else $this->mOptions[$option] = $default;
 29+ if ( isset( $options[$option] ) && !is_null( $options[$option] ) ) {
 30+ $this->mOptions[$option] = $options[$option];
 31+ } else {
 32+ $this->mOptions[$option] = $default;
 33+ }
3234 }
3335
3436 $this->mOptions['mode'] = self::decodeMode( $this->mOptions['mode'] );
3537
3638 if ( $this->mOptions['mode'] == CT_MODE_PARENTS ) {
37 - $this->mOptions['namespaces'] = false; #namespace filter makes no sense with CT_MODE_PARENTS
 39+ $this->mOptions['namespaces'] = false; # namespace filter makes no sense with CT_MODE_PARENTS
3840 }
3941
4042 $this->mOptions['hideprefix'] = self::decodeHidePrefix( $this->mOptions['hideprefix'] );
@@ -42,7 +44,7 @@
4345
4446 if ( $this->mOptions['namespaces'] ) {
4547 # automatically adjust mode to match namespace filter
46 - if ( sizeof( $this->mOptions['namespaces'] ) === 1
 48+ if ( sizeof( $this->mOptions['namespaces'] ) === 1
4749 && $this->mOptions['namespaces'][0] == NS_CATEGORY ) {
4850 $this->mOptions['mode'] = CT_MODE_CATEGORIES;
4951 } else if ( !in_array( NS_IMAGE, $this->mOptions['namespaces'] ) ) {
@@ -58,7 +60,7 @@
5961 }
6062
6163 function isInverse( ) {
62 - return $this->getOption('mode') == CT_MODE_PARENTS;
 64+ return $this->getOption( 'mode' ) == CT_MODE_PARENTS;
6365 }
6466
6567 static function decodeNamespaces( $nn ) {
@@ -67,7 +69,7 @@
6870 if ( !$nn )
6971 return false;
7072
71 - if ( !is_array($nn) )
 73+ if ( !is_array( $nn ) )
7274 $nn = preg_split( '![\s#:|]+!', $nn );
7375
7476 $namespaces = array();
@@ -79,10 +81,10 @@
8082 else {
8183 $n = trim( $n );
8284 if ( $n === '' ) continue;
83 -
 85+
8486 $lower = strtolower( $n );
85 -
86 - if ( is_numeric($n) ) $ns = (int)$n;
 87+
 88+ if ( is_numeric( $n ) ) $ns = (int)$n;
8789 elseif ( $n == '-' || $n == '_' || $n == '*' || $lower == 'main' ) $ns = NS_MAIN;
8890 else $ns = $wgContLang->getNsIndex( $n );
8991 }
@@ -145,7 +147,7 @@
146148
147149 if ( $value == 'yes' || $value == 'y' || $value == 'true' || $value == 't' || $value == 'on' ) return CT_HIDEPREFIX_ALWAYS;
148150 else if ( $value == 'no' || $value == 'n' || $value == 'false' || $value == 'f' || $value == 'off' ) return CT_HIDEPREFIX_NEVER;
149 - //else if ( $value == 'null' || $value == 'default' || $value == 'none' || $value == 'x' ) return $wgCategoryTreeDefaultOptions['hideprefix'];
 151+ // else if ( $value == 'null' || $value == 'default' || $value == 'none' || $value == 'x' ) return $wgCategoryTreeDefaultOptions['hideprefix'];
150152 else if ( $value == 'always' ) return CT_HIDEPREFIX_ALWAYS;
151153 else if ( $value == 'never' ) return CT_HIDEPREFIX_NEVER;
152154 else if ( $value == 'auto' ) return CT_HIDEPREFIX_AUTO;
@@ -160,7 +162,6 @@
161163 static function setHeaders( &$outputPage ) {
162164 global $wgJsMimeType, $wgScriptPath, $wgContLang;
163165 global $wgCategoryTreeHijackPageCategories, $wgCategoryTreeExtPath, $wgCategoryTreeVersion;
164 - self::init();
165166
166167 # Register css file for CategoryTree
167168 $outputPage->addLink(
@@ -180,7 +181,7 @@
181182 }
182183
183184 # Register css RTL file for CategoryTree
184 - if( $wgContLang->isRTL() ) {
 185+ if ( $wgContLang->isRTL() ) {
185186 $outputPage->addLink(
186187 array(
187188 'rel' => 'stylesheet',
@@ -199,27 +200,27 @@
200201 # Add messages
201202 $outputPage->addScript(
202203 " <script type=\"{$wgJsMimeType}\">
203 - var categoryTreeCollapseMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-collapse'))."\";
204 - var categoryTreeExpandMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-expand'))."\";
205 - var categoryTreeCollapseBulletMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-collapse-bullet'))."\";
206 - var categoryTreeExpandBulletMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-expand-bullet'))."\";
207 - var categoryTreeLoadMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-load'))."\";
208 - var categoryTreeLoadingMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-loading'))."\";
209 - var categoryTreeNothingFoundMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-nothing-found'))."\";
210 - var categoryTreeNoSubcategoriesMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-no-subcategories'))."\";
211 - var categoryTreeNoParentCategoriesMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-no-parent-categories'))."\";
212 - var categoryTreeNoPagesMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-no-pages'))."\";
213 - var categoryTreeErrorMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-error'))."\";
214 - var categoryTreeRetryMsg = \"".Xml::escapeJsString(wfMsgNoTrans('categorytree-retry'))."\";
215 - </script>\n"
 204+ var categoryTreeCollapseMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-collapse' ) ) . "\";
 205+ var categoryTreeExpandMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-expand' ) ) . "\";
 206+ var categoryTreeCollapseBulletMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-collapse-bullet' ) ) . "\";
 207+ var categoryTreeExpandBulletMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-expand-bullet' ) ) . "\";
 208+ var categoryTreeLoadMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-load' ) ) . "\";
 209+ var categoryTreeLoadingMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-loading' ) ) . "\";
 210+ var categoryTreeNothingFoundMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-nothing-found' ) ) . "\";
 211+ var categoryTreeNoSubcategoriesMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-no-subcategories' ) ) . "\";
 212+ var categoryTreeNoParentCategoriesMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-no-parent-categories' ) ) . "\";
 213+ var categoryTreeNoPagesMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-no-pages' ) ) . "\";
 214+ var categoryTreeErrorMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-error' ) ) . "\";
 215+ var categoryTreeRetryMsg = \"" . Xml::escapeJsString( wfMsgNoTrans( 'categorytree-retry' ) ) . "\";
 216+ </script>\n"
216217 );
217218 }
218219
219220 static function getJsonCodec() {
220221 static $json = null;
221222
222 - if (!$json) {
223 - $json = new Services_JSON(); #recycle API's JSON codec implementation
 223+ if ( !$json ) {
 224+ $json = new Services_JSON(); # recycle API's JSON codec implementation
224225 }
225226
226227 return $json;
@@ -227,9 +228,9 @@
228229
229230 static function encodeOptions( $options, $enc ) {
230231 if ( $enc == 'mode' || $enc == '' ) {
231 - $opt =$options['mode'];
 232+ $opt = $options['mode'];
232233 } elseif ( $enc == 'json' ) {
233 - $json = self::getJsonCodec(); //XXX: this may be a bit heavy...
 234+ $json = self::getJsonCodec(); // XXX: this may be a bit heavy...
234235 $opt = $json->encode( $options );
235236 } else {
236237 throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc );
@@ -242,21 +243,10 @@
243244 if ( $enc == 'mode' || $enc == '' ) {
244245 $opt = array( "mode" => $options );
245246 } elseif ( $enc == 'json' ) {
246 - $json = self::getJsonCodec(); //XXX: this may be a bit heavy...
 247+ $json = self::getJsonCodec(); // XXX: this may be a bit heavy...
247248 $opt = $json->decode( $options );
248249 $opt = get_object_vars( $opt );
249 - } /* elseif () {
250 - foreach ( $oo as $o ) {
251 - if ($o === "") continue;
252 -
253 - if ( preg_match( '!^(.*?)=(.*)$!', $o, $m ) {
254 - $n = $m[1];
255 - $opt[$n] = $m[2];
256 - } else {
257 - $opt[$o] = true;
258 - }
259 - }
260 - } */ else {
 250+ } else {
261251 throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc );
262252 }
263253
@@ -296,7 +286,7 @@
297287
298288 foreach ( $this->mOptions as $k => $v ) {
299289 if ( $u != '' ) $u .= '&';
300 - $u .= $k . '=' . urlencode($v) ;
 290+ $u .= $k . '=' . urlencode( $v ) ;
301291 }
302292
303293 return $u;
@@ -307,11 +297,16 @@
308298 * load CategoryTreeFunctions.php on demand.
309299 */
310300 function ajax( $category, $depth = 1 ) {
311 - global $wgDBname;
 301+ global $wgDBname, $wgUser;
312302 $title = self::makeTitle( $category );
313303
314 - if ( ! $title ) return false; #TODO: error message?
 304+ if ( ! $title ) {
 305+ return false; # TODO: error message?
 306+ }
315307
 308+ # configkey needed to take into account variant and secure options.
 309+ $configkey = $wgUser->getPageRenderingHash();
 310+
316311 # Retrieve page_touched for the category
317312 $dbkey = $title->getDBkey();
318313 $dbr = wfGetDB( DB_SLAVE );
@@ -321,7 +316,7 @@
322317 'page_title' => $dbkey,
323318 ), __METHOD__ );
324319
325 - $mckey = "$wgDBname:categorytree(" . $this->getOptionsAsCacheKey( $depth ) . "):$dbkey";
 320+ $mckey = "$wgDBname:categorytree(" . $this->getOptionsAsCacheKey( $depth ) . "):$dbkey:$configkey";
326321
327322 $response = new AjaxResponse();
328323
@@ -333,10 +328,13 @@
334329 return $response;
335330 }
336331
337 - $html = $this->renderChildren( $title, $depth );
 332+ $html = $this->renderChildren( $title, $depth );
338333
339 - if ( $html == '' ) $html = ' '; #HACK: Safari doesn't like empty responses.
340 - #see Bug 7219 and http://bugzilla.opendarwin.org/show_bug.cgi?id=10716
 334+ if ( $html == '' ) {
 335+ # HACK: Safari doesn't like empty responses.
 336+ # see Bug 7219 and http://bugzilla.opendarwin.org/show_bug.cgi?id=10716
 337+ $html = ' ';
 338+ }
341339
342340 $response->addText( $html );
343341
@@ -349,7 +347,7 @@
350348 * Custom tag implementation. This is called by efCategoryTreeParserHook, which is used to
351349 * load CategoryTreeFunctions.php on demand.
352350 */
353 - function getTag( $parser, $category, $hideroot = false, $attr, $depth=1, $allowMissing = false ) {
 351+ function getTag( $parser, $category, $hideroot = false, $attr, $depth = 1, $allowMissing = false ) {
354352 global $wgCategoryTreeDisableCache, $wgCategoryTreeDynamicTag;
355353 static $uniq = 0;
356354
@@ -357,24 +355,29 @@
358356 if ( $category === '' ) {
359357 return false;
360358 }
 359+
361360 if ( $parser && $wgCategoryTreeDisableCache && !$wgCategoryTreeDynamicTag ) {
362361 $parser->disableCache();
363362 }
 363+
364364 $title = self::makeTitle( $category );
365365
366 - if ( $title === false || $title === null ) return false;
 366+ if ( $title === false || $title === null ) {
 367+ return false;
 368+ }
367369
368 - if ( isset( $attr['class'] ) ) $attr['class'] .= ' CategoryTreeTag';
369 - else $attr['class'] = ' CategoryTreeTag';
 370+ if ( isset( $attr['class'] ) ) {
 371+ $attr['class'] .= ' CategoryTreeTag';
 372+ } else {
 373+ $attr['class'] = ' CategoryTreeTag';
 374+ }
370375
371 - $this->init();
372 -
373376 $html = '';
374377 $html .= Xml::openElement( 'div', $attr );
375378
376379 if ( !$allowMissing && !$title->getArticleID() ) {
377380 $html .= Xml::openElement( 'span', array( 'class' => 'CategoryTreeNotice' ) );
378 - if( $parser ) {
 381+ if ( $parser ) {
379382 $html .= $parser->recursiveTagParse( wfMsgNoTrans( 'categorytree-not-found', $category ) );
380383 } else {
381384 $html .= wfMsgExt( 'categorytree-not-found', 'parseinline', htmlspecialchars( $category ) );
@@ -382,9 +385,11 @@
383386 $html .= Xml::closeElement( 'span' );
384387 }
385388 else {
386 - if ( !$hideroot ) $html .= CategoryTree::renderNode( $title, $depth, $wgCategoryTreeDynamicTag );
387 - else if ( !$wgCategoryTreeDynamicTag ) $html .= $this->renderChildren( $title, $depth );
388 - else {
 389+ if ( !$hideroot ) {
 390+ $html .= CategoryTree::renderNode( $title, $depth, $wgCategoryTreeDynamicTag );
 391+ } else if ( !$wgCategoryTreeDynamicTag ) {
 392+ $html .= $this->renderChildren( $title, $depth );
 393+ } else {
389394 $uniq += 1;
390395 $load = 'ct-' . $uniq . '-' . mt_rand( 1, 100000 );
391396
@@ -404,10 +409,10 @@
405410 * Returns a string with an HTML representation of the children of the given category.
406411 * $title must be a Title object
407412 */
408 - function renderChildren( &$title, $depth=1 ) {
 413+ function renderChildren( &$title, $depth = 1 ) {
409414 global $wgCategoryTreeMaxChildren, $wgCategoryTreeUseCategoryTable;
410415
411 - if( $title->getNamespace() != NS_CATEGORY ) {
 416+ if ( $title->getNamespace() != NS_CATEGORY ) {
412417 // Non-categories can't have children. :)
413418 return '';
414419 }
@@ -415,8 +420,8 @@
416421 $dbr = wfGetDB( DB_SLAVE );
417422
418423 $inverse = $this->isInverse();
419 - $mode = $this->getOption('mode');
420 - $namespaces = $this->getOption('namespaces');
 424+ $mode = $this->getOption( 'mode' );
 425+ $namespaces = $this->getOption( 'namespaces' );
421426
422427 if ( $inverse ) {
423428 $ctJoinCond = ' ON cl_to = cat.page_title AND cat.page_namespace = ' . NS_CATEGORY;
@@ -429,20 +434,27 @@
430435 $ctWhere = ' cl_to = ' . $dbr->addQuotes( $title->getDBkey() );
431436 $ctJoin = ' JOIN ';
432437
433 - #namespace filter.
 438+ # namespace filter.
434439 if ( $namespaces ) {
435 - #NOTE: we assume that the $namespaces array contains only integers! decodeNamepsaces makes it so.
436 - if ( sizeof( $namespaces ) === 1 ) $nsmatch = ' AND cat.page_namespace = ' . $namespaces[0] . ' ';
437 - else $nsmatch = ' AND cat.page_namespace IN ( ' . implode( ', ', $namespaces ) . ') ';
 440+ # NOTE: we assume that the $namespaces array contains only integers! decodeNamepsaces makes it so.
 441+ if ( sizeof( $namespaces ) === 1 ) {
 442+ $nsmatch = ' AND cat.page_namespace = ' . $namespaces[0] . ' ';
 443+ } else {
 444+ $nsmatch = ' AND cat.page_namespace IN ( ' . implode( ', ', $namespaces ) . ') ';
 445+ }
438446 }
439447 else {
440 - if ( $mode == CT_MODE_ALL ) $nsmatch = '';
441 - else if ( $mode == CT_MODE_PAGES ) $nsmatch = ' AND cat.page_namespace != ' . NS_IMAGE;
442 - else $nsmatch = ' AND cat.page_namespace = ' . NS_CATEGORY;
 448+ if ( $mode == CT_MODE_ALL ) {
 449+ $nsmatch = '';
 450+ } else if ( $mode == CT_MODE_PAGES ) {
 451+ $nsmatch = ' AND cat.page_namespace != ' . NS_IMAGE;
 452+ } else {
 453+ $nsmatch = ' AND cat.page_namespace = ' . NS_CATEGORY;
 454+ }
443455 }
444456 }
445457
446 - #additional stuff to be used if "transaltion" by interwiki-links is desired
 458+ # additional stuff to be used if "transaltion" by interwiki-links is desired
447459 $transFields = '';
448460 $transJoin = '';
449461 $transWhere = '';
@@ -472,25 +484,24 @@
473485 $countJoin
474486 WHERE $ctWhere
475487 $nsmatch
476 - "./*AND cat.page_is_redirect = 0*/"
 488+ " . /*AND cat.page_is_redirect = 0*/"
477489 $transWhere
478490 ORDER BY cl_sortkey";
479 - $sql = $dbr->limitResult($sql, (int)$wgCategoryTreeMaxChildren);
480 -
 491+ $sql = $dbr->limitResult( $sql, (int)$wgCategoryTreeMaxChildren );
 492+
481493 $res = $dbr->query( $sql, __METHOD__ );
482494
483 - #collect categories separately from other pages
484 - $categories= '';
485 - $other= '';
 495+ # collect categories separately from other pages
 496+ $categories = '';
 497+ $other = '';
486498
487499 while ( $row = $dbr->fetchObject( $res ) ) {
488 - #NOTE: in inverse mode, the page record may be null, because we use a right join.
 500+ # NOTE: in inverse mode, the page record may be null, because we use a right join.
489501 # happens for categories with no category page (red cat links)
490502 if ( $inverse && $row->page_title === null ) {
491503 $t = Title::makeTitle( NS_CATEGORY, $row->cl_to );
492 - }
493 - else {
494 - #TODO: translation support; ideally added to Title object
 504+ } else {
 505+ # TODO: translation support; ideally added to Title object
495506 $t = Title::newFromRow( $row );
496507 }
497508
@@ -500,11 +511,14 @@
501512 $cat = Category::newFromRow( $row, $t );
502513 }
503514
504 - $s = $this->renderNodeInfo( $t, $cat, $depth-1, false );
 515+ $s = $this->renderNodeInfo( $t, $cat, $depth -1, false );
505516 $s .= "\n\t\t";
506517
507 - if ($row->page_namespace == NS_CATEGORY) $categories .= $s;
508 - else $other .= $s;
 518+ if ( $row->page_namespace == NS_CATEGORY ) {
 519+ $categories .= $s;
 520+ } else {
 521+ $other .= $s;
 522+ }
509523 }
510524
511525 $dbr->freeResult( $res );
@@ -521,7 +535,7 @@
522536
523537 $dbr = wfGetDB( DB_SLAVE );
524538
525 - #additional stuff to be used if "transaltion" by interwiki-links is desired
 539+ # additional stuff to be used if "transaltion" by interwiki-links is desired
526540 $transFields = '';
527541 $transJoin = '';
528542 $transWhere = '';
@@ -534,23 +548,23 @@
535549 WHERE cl_from = " . $title->getArticleID() . "
536550 $transWhere
537551 ORDER BY cl_to";
538 - $sql = $dbr->limitResult($sql, (int)$wgCategoryTreeMaxChildren);
 552+ $sql = $dbr->limitResult( $sql, (int)$wgCategoryTreeMaxChildren );
539553
540554 $res = $dbr->query( $sql, __METHOD__ );
541555
542556 $special = Title::makeTitle( NS_SPECIAL, 'CategoryTree' );
543557
544 - $s= '';
 558+ $s = '';
545559
546560 while ( $row = $dbr->fetchObject( $res ) ) {
547 - #TODO: translation support; ideally added to Title object
 561+ # TODO: translation support; ideally added to Title object
548562 $t = Title::newFromRow( $row );
549563
550 - #$trans = $title->getLocalizedText();
551 - $trans = ''; #place holder for when translated titles are available
 564+ # $trans = $title->getLocalizedText();
 565+ $trans = ''; # place holder for when translated titles are available
552566
553567 $label = htmlspecialchars( $t->getText() );
554 - if ( $trans && $trans!=$label ) $label.= ' ' . Xml::element( 'i', array( 'class' => 'translation'), $trans );
 568+ if ( $trans && $trans != $label ) $label .= ' ' . Xml::element( 'i', array( 'class' => 'translation' ), $trans );
555569
556570 $wikiLink = $special->getLocalURL( 'target=' . $t->getPartialURL() . '&' . $this->getOptionsAsUrlParameters() );
557571
@@ -577,8 +591,9 @@
578592
579593 if ( $wgCategoryTreeUseCategoryTable && $title->getNamespace() == NS_CATEGORY && !$this->isInverse() ) {
580594 $cat = Category::newFromTitle( $title );
 595+ } else {
 596+ $cat = null;
581597 }
582 - else $cat = NULL;
583598
584599 return $this->renderNodeInfo( $title, $cat, $children, $loadchildren );
585600 }
@@ -588,11 +603,10 @@
589604 * $info must be an associative array, containing at least a Title object under the 'title' key.
590605 */
591606 function renderNodeInfo( $title, $cat, $children = 0, $loadchildren = false ) {
 607+ global $wgCategoryTreeMaxScanRows;
592608 static $uniq = 0;
593609
594 - $this->init(); # initialize messages
595 -
596 - $mode = $this->getOption('mode');
 610+ $mode = $this->getOption( 'mode' );
597611 $load = false;
598612
599613 if ( $children > 0 && $loadchildren ) {
@@ -604,22 +618,32 @@
605619 $ns = $title->getNamespace();
606620 $key = $title->getDBkey();
607621
608 - #$trans = $title->getLocalizedText();
609 - $trans = ''; #place holder for when translated titles are available
 622+ # $trans = $title->getLocalizedText();
 623+ $trans = ''; # place holder for when translated titles are available
610624
611 - $hideprefix = $this->getOption('hideprefix');
 625+ $hideprefix = $this->getOption( 'hideprefix' );
612626
613 - if ( $hideprefix == CT_HIDEPREFIX_ALWAYS ) $hideprefix = true;
614 - else if ( $hideprefix == CT_HIDEPREFIX_AUTO ) $hideprefix = ($mode == CT_MODE_CATEGORIES);
615 - else if ( $hideprefix == CT_HIDEPREFIX_CATEGORIES ) $hideprefix = ($ns == NS_CATEGORY);
616 - else $hideprefix = true;
 627+ if ( $hideprefix == CT_HIDEPREFIX_ALWAYS ) {
 628+ $hideprefix = true;
 629+ } else if ( $hideprefix == CT_HIDEPREFIX_AUTO ) {
 630+ $hideprefix = ( $mode == CT_MODE_CATEGORIES );
 631+ } else if ( $hideprefix == CT_HIDEPREFIX_CATEGORIES ) {
 632+ $hideprefix = ( $ns == NS_CATEGORY );
 633+ } else {
 634+ $hideprefix = true;
 635+ }
617636
618 - #when showing only categories, omit namespace in label unless we explicitely defined the configuration setting
619 - #patch contributed by Manuel Schneider <manuel.schneider@wikimedia.ch>, Bug 8011
620 - if ( $hideprefix ) $label = htmlspecialchars( $title->getText() );
621 - else $label = htmlspecialchars( $title->getPrefixedText() );
 637+ # when showing only categories, omit namespace in label unless we explicitely defined the configuration setting
 638+ # patch contributed by Manuel Schneider <manuel.schneider@wikimedia.ch>, Bug 8011
 639+ if ( $hideprefix ) {
 640+ $label = htmlspecialchars( $title->getText() );
 641+ } else {
 642+ $label = htmlspecialchars( $title->getPrefixedText() );
 643+ }
622644
623 - if ( $trans && $trans!=$label ) $label.= ' ' . Xml::element( 'i', array( 'class' => 'translation'), $trans );
 645+ if ( $trans && $trans != $label ) {
 646+ $label .= ' ' . Xml::element( 'i', array( 'class' => 'translation' ), $trans );
 647+ }
624648
625649 $labelClass = 'CategoryTreeLabel ' . ' CategoryTreeLabelNs' . $ns;
626650
@@ -636,12 +660,14 @@
637661 $labelClass .= ' CategoryTreeLabelPage';
638662 }
639663
640 - if ( ( $ns % 2 ) > 0 ) $labelClass .= ' CategoryTreeLabelTalk';
 664+ if ( ( $ns % 2 ) > 0 ) {
 665+ $labelClass .= ' CategoryTreeLabelTalk';
 666+ }
641667
642668 $count = false;
643669 $s = '';
644670
645 - #NOTE: things in CategoryTree.js rely on the exact order of tags!
 671+ # NOTE: things in CategoryTree.js rely on the exact order of tags!
646672 # Specifically, the CategoryTreeChildren div must be the first
647673 # sibling with nodeName = DIV of the grandparent of the expland link.
648674
@@ -649,57 +675,66 @@
650676 $s .= Xml::openElement( 'div', array( 'class' => 'CategoryTreeItem' ) );
651677
652678 $attr = array( 'class' => 'CategoryTreeBullet' );
653 - $s .= Xml::openElement( 'span', $attr );
654679
 680+ # Get counts, with conversion to integer so === works
 681+ $pageCount = intval( $cat->getPageCount() );
 682+ $subcatCount = intval( $cat->getSubcatCount() );
 683+ $fileCount = intval( $cat->getFileCount() );
 684+
655685 if ( $ns == NS_CATEGORY ) {
 686+
656687 if ( $cat ) {
657 - if ( $mode == CT_MODE_CATEGORIES ) $count = $cat->getSubcatCount();
658 - else if ( $mode == CT_MODE_PAGES ) $count = $cat->getPageCount() - $cat->getFileCount();
659 - else $count = $cat->getPageCount();
 688+ if ( $mode == CT_MODE_CATEGORIES ) {
 689+ $count = $subcatCount;
 690+ } else if ( $mode == CT_MODE_PAGES ) {
 691+ $count = $pageCount - $fileCount;
 692+ } else {
 693+ $count = $pageCount;
 694+ }
660695 }
661 -
662 - $linkattr= array( );
663 - if ( $load ) $linkattr[ 'id' ] = $load;
 696+ if ( $count === 0 || $pageCount > $wgCategoryTreeMaxScanRows ) {
 697+ $bullet = wfMsgNoTrans( 'categorytree-empty-bullet' ) . ' ';
 698+ $attr['class'] = 'CategoryTreeEmptyBullet';
 699+ } else {
 700+ $linkattr = array( );
 701+ if ( $load ) {
 702+ $linkattr[ 'id' ] = $load;
 703+ }
664704
665 - $linkattr[ 'class' ] = "CategoryTreeToggle";
666 - $linkattr['style'] = 'display: none;'; // Unhidden by JS
 705+ $linkattr[ 'class' ] = "CategoryTreeToggle";
 706+ $linkattr['style'] = 'display: none;'; // Unhidden by JS
667707
668 - /*if ( $count === 0 ) {
669 - $tag = 'span';
670 - $txt = wfMsgNoTrans( 'categorytree-empty-bullet' );
 708+ if ( $children == 0 || $loadchildren ) {
 709+ $tag = 'span';
 710+ $txt = wfMsgNoTrans( 'categorytree-expand-bullet' );
 711+ $linkattr[ 'onclick' ] = "if (this.href) this.href='javascript:void(0)'; categoryTreeExpandNode('" . Xml::escapeJsString( $key ) . "'," . $this->getOptionsAsJsStructure() . ",this);";
 712+ # Don't load this message for ajax requests, so that we don't have to initialise $wgLang
 713+ $linkattr[ 'title' ] = $this->mIsAjaxRequest ? '##LOAD##' : wfMsgNoTrans( 'categorytree-expand' );
 714+ } else {
 715+ $tag = 'span';
 716+ $txt = wfMsgNoTrans( 'categorytree-collapse-bullet' );
 717+ $linkattr[ 'onclick' ] = "if (this.href) this.href='javascript:void(0)'; categoryTreeCollapseNode('" . Xml::escapeJsString( $key ) . "'," . $this->getOptionsAsJsStructure() . ",this);";
 718+ $linkattr[ 'title' ] = wfMsgNoTrans( 'categorytree-collapse' );
 719+ $linkattr[ 'class' ] .= ' CategoryTreeLoaded';
 720+ }
 721+
 722+ if ( $tag == 'a' ) {
 723+ $linkattr[ 'href' ] = $wikiLink;
 724+ }
 725+ $bullet = Xml::openElement( $tag, $linkattr ) . $txt . Xml::closeElement( $tag ) . ' ';
671726 }
672 - else*/
673 - if ( $children == 0 || $loadchildren ) {
674 - $tag = 'span';
675 - if ( $count === 0 ) $txt = wfMsgNoTrans( 'categorytree-empty-bullet' );
676 - else $txt = wfMsgNoTrans( 'categorytree-expand-bullet' );
677 - $linkattr[ 'onclick' ] = "if (this.href) this.href='javascript:void(0)'; categoryTreeExpandNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
678 - # Don't load this message for ajax requests, so that we don't have to initialise $wgLang
679 - $linkattr[ 'title' ] = $this->mIsAjaxRequest ? '##LOAD##' : wfMsgNoTrans('categorytree-expand');
680 - }
681 - else {
682 - $tag = 'span';
683 - $txt = wfMsgNoTrans( 'categorytree-collapse-bullet' );
684 - $linkattr[ 'onclick' ] = "if (this.href) this.href='javascript:void(0)'; categoryTreeCollapseNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
685 - $linkattr[ 'title' ] = wfMsgNoTrans('categorytree-collapse');
686 - $linkattr[ 'class' ] .= ' CategoryTreeLoaded';
687 - }
688 -
689 - if ( $tag == 'a' ) $linkattr[ 'href' ] = $wikiLink;
690 - $s .= Xml::openElement( $tag, $linkattr ) . $txt . Xml::closeElement( $tag ) . ' ';
691727 } else {
692 - $s .= wfMsgNoTrans( 'categorytree-page-bullet' );
 728+ $bullet = wfMsgNoTrans( 'categorytree-page-bullet' );
693729 }
 730+ $s .= Xml::tags( 'span', $attr, $bullet ) . ' ';
694731
695 - $s .= Xml::closeElement( 'span' );
696 -
697732 $s .= Xml::openElement( 'a', array( 'class' => $labelClass, 'href' => $wikiLink ) ) . $label . Xml::closeElement( 'a' );
698733
699734 if ( $count !== false && $this->getOption( 'showcount' ) ) {
700 - $pages = $cat->getPageCount() - $cat->getSubcatCount() - $cat->getFileCount();
 735+ $pages = $pageCount - $subcatCount - $fileCount;
701736
702737 $attr = array(
703 - 'title' => wfMsgExt( 'categorytree-member-counts', 'parsemag', $cat->getSubcatCount(), $pages , $cat->getFileCount(), $cat->getPageCount(), $count )
 738+ 'title' => wfMsgExt( 'categorytree-member-counts', 'parsemag', $subcatCount, $pages , $fileCount, $pageCount, $count )
704739 );
705740
706741 $s .= ' ';
@@ -707,25 +742,30 @@
708743 $s .= Xml::tags( 'span', $attr,
709744 wfMsgExt( 'categorytree-member-num',
710745 array( 'parsemag', 'escapenoentities' ),
711 - $cat->getSubcatCount(),
 746+ $subcatCount,
712747 $pages,
713 - $cat->getFileCount(),
714 - $cat->getPageCount(),
 748+ $fileCount,
 749+ $pageCount,
715750 $wgLang->formatNum( $count ) ) );
716751 }
717752
718753 $s .= Xml::closeElement( 'div' );
719754 $s .= "\n\t\t";
720755 $s .= Xml::openElement( 'div', array( 'class' => 'CategoryTreeChildren', 'style' => $children > 0 ? "display:block" : "display:none" ) );
721 -
722 - if ( $ns == NS_CATEGORY && $children > 0 && !$loadchildren) {
 756+
 757+ if ( $ns == NS_CATEGORY && $children > 0 && !$loadchildren ) {
723758 $children = $this->renderChildren( $title, $children );
724759 if ( $children == '' ) {
725760 $s .= Xml::openElement( 'i', array( 'class' => 'CategoryTreeNotice' ) );
726 - if ( $mode == CT_MODE_CATEGORIES ) $s .= wfMsgExt( 'categorytree-no-subcategories', 'parsemag');
727 - else if ( $mode == CT_MODE_PAGES ) $s .= wfMsgExt( 'categorytree-no-pages', 'parsemag');
728 - else if ( $mode == CT_MODE_PARENTS ) $s .= wfMsgExt( 'categorytree-no-parent-categories', 'parsemag');
729 - else $s .= wfMsgExt( 'categorytree-nothing-found', 'parsemag');
 761+ if ( $mode == CT_MODE_CATEGORIES ) {
 762+ $s .= wfMsgExt( 'categorytree-no-subcategories', 'parsemag' );
 763+ } else if ( $mode == CT_MODE_PAGES ) {
 764+ $s .= wfMsgExt( 'categorytree-no-pages', 'parsemag' );
 765+ } else if ( $mode == CT_MODE_PARENTS ) {
 766+ $s .= wfMsgExt( 'categorytree-no-parent-categories', 'parsemag' );
 767+ } else {
 768+ $s .= wfMsgExt( 'categorytree-nothing-found', 'parsemag' );
 769+ }
730770 $s .= Xml::closeElement( 'i' );
731771 } else {
732772 $s .= $children;
@@ -738,7 +778,7 @@
739779 if ( $load ) {
740780 $s .= "\n\t\t";
741781 $s .= Xml::openElement( 'script', array( 'type' => 'text/javascript' ) );
742 - $s .= 'categoryTreeExpandNode("'.Xml::escapeJsString($key).'", '.$this->getOptionsAsJsStructure($children).', document.getElementById("'.$load.'"));';
 782+ $s .= 'categoryTreeExpandNode("' . Xml::escapeJsString( $key ) . '", ' . $this->getOptionsAsJsStructure( $children ) . ', document.getElementById("' . $load . '"));';
743783 $s .= Xml::closeElement( 'script' );
744784 }
745785
@@ -753,7 +793,7 @@
754794 static function makeTitle( $title ) {
755795 global $wgContLang, $wgCanonicalNamespaceNames;
756796
757 - $title = trim($title);
 797+ $title = trim( $title );
758798
759799 if ( $title === null || $title === '' || $title === false ) {
760800 return null;
@@ -768,18 +808,4 @@
769809 }
770810 return $t;
771811 }
772 -
773 - /**
774 - * Initialize. Load messages, if not ajax request.
775 - */
776 - static function init( ) {
777 - static $initialized = false;
778 - if ( $initialized ) return;
779 - $initialized = true;
780 -
781 - #NOTE: don't load messages for ajax requests. Ajax requests are cachable and language-neutral.
782 - # Messages used in JS are defined by setHeaders
783 - if ( !isset( $this ) || !$this->mIsAjaxRequest )
784 - wfLoadExtensionMessages( 'CategoryTree' );
785 - }
786812 }
Index: branches/wmf/1.16wmf4/extensions/CategoryTree/README
@@ -16,4 +16,3 @@
1717
1818 Instructions on installing and using this extension are available at
1919 <http://www.mediawiki.org/wiki/Extension:CategoryTree>
20 -
Property changes on: branches/wmf/1.16wmf4/extensions/CategoryTree
___________________________________________________________________
Name: svn:mergeinfo
2120 + /branches/wmf-deployment/extensions/CategoryTree:60970
/trunk/extensions/CategoryTree:62820-67179
/trunk/phase3/extensions/CategoryTree:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62820Branch for MediaWiki 1.16tstarling11:21, 22 February 2010
r66987* (bug 23682) Don't allow people to expand subtree when it's known to be empt...tstarling02:15, 28 May 2010
r67179* Per Aryeh's suggestion on CR r66987, treat categories larger than a certain...tstarling08:58, 1 June 2010

Status & tagging log