Commit graph

118 commits

Author SHA1 Message Date
Fomafix 6b8933be55 Remove dead code
Change-Id: I494fbf146ad905d07e2d67a55fdec7092e778c46
2014-12-01 00:27:18 +00:00
addshore 7a749a6e9a Use public instead of var in classes
Change-Id: I6c34c0f15c9759e9e2b04fd6da93e5c577a40ce5
2014-08-17 22:03:48 +01:00
Brian Wolff daf3e2d9f1 Unbreak this extension by killing $wgCategoryTreeDynamicTag
Somewhere along the line this extension's JS was refactored,
except for a part which was left as is, and was calling functions
since renamed, and still assuming top loaded...

Just kill $wgCategoryTreeDynamicTag, since it doesn't work, it
hasn't worked for a while, and it looks like a bit of work to
make it work properly. Also change the cache disabling defaults
of this extension to be 6 hours so it doesn't cause explosions.

If someone wants the feature represented by $wgCategoryTreeDynamicTag
they can of course re-introduce it in a subsequent commit. In the
mean time, let's not have broken code.

Bug: 59798
Change-Id: I01e0bd264e2a007cd9de017d10667bb2809d70a9
2014-02-19 22:15:55 -04:00
Siebrand Mazeland 3aff44cc17 Correct Title::getInterwiki method name case on call
Change-Id: I9795d208106b5566b450c4a4ceafd9dbefd0ac0b
2014-01-23 20:00:27 +00:00
Vitaliy Filippov 57b0bbe2dd Do not re-implement http_build_query :-)
Change-Id: I9057bce11d7b1c1738f87eaf523ecbaf21b4b596
2013-01-20 22:40:40 +04:00
Reedy ab0a4924fc Bug 43253 - SQL query error in CategoryTree::renderParents
Change-Id: Icc6bf66ca9cdabce417801ca5452e684ff83e6b8
2012-12-19 13:59:55 +00:00
Reedy 60c1daf225 Bug 43077 - CategoryTree git/master does not work with mw 1.20.2 branch
Change-Id: Idf11cf0ffa9ba63fef1c17a5c2b281294748a3f6
2012-12-13 20:36:50 +00:00
Reedy 52e0061e21 Fix mistake from g34493
cl_to had been swapped for cl_title. Revert this

Change-Id: Ieff9ba46a55167b390048afe054371a81f2ccd66
2012-12-04 13:02:56 +00:00
Reedy b2a50356fd Change raw sql into query wrapper
Remove some unused variables (set to '' and never set for use in query)

Wrap some long lines

Add a few braces

Add CategoryTreeCategoryViewer to AutoloadClasses

Add @var type docs for member variable

Change-Id: I77c870a9159a4e16a4fe172ac007b28a221cb090
2012-11-22 16:53:49 +00:00
Reedy 5a1d878db3 Bug 42110 - CategoryTree: urlencode() expects parameter 1 to be string, array given
Change-Id: Ifcf24a567916d71bdc5c6ef1d27f16892708b915
2012-11-21 23:26:21 +00:00
eranroz f5d36e1dbd Namespace selection option in Special:CategoryTree
This patch adds namespace selection interface in Special:CategoryTree.
Without this patch, this useful option is allowed only through URL manipulation.
The options are now wrapped within table.

Change-Id: Ib7152320c18edc8a428846945aa0949b43df39f2
2012-11-02 00:28:43 +02:00
Siebrand Mazeland 0aeed5ffee Fix regression in I331af864: $subcatCount was dropped accidentally.
Should be cherry picked in 1.20wmf12.

Change-Id: If0a461f8db6a5c8a3b919cf63f2f1f92b74f1534
2012-09-19 12:25:42 -07:00
Siebrand Mazeland fb438e7cc9 (bug 40151) Do not use numParams on params 1-4.
Do not use numParams on params 1-4, as they are only used for customisation.

Change-Id: I331af864c4fe04ac10180e0dd311be8f73b4f634
2012-09-12 09:28:06 -07:00
Siebrand Mazeland 92f3e2f909 Maintenance for CategoryTree extension
* Drop MSIE 5.0 and 5.5 hack in CSS.
* Replace use of deprecated wfMsg* functions.
* Update documentation for two methods.
* Update code formatting (long lines, {}).

Change-Id: I9601e9263b9a188d4a843c3be8ee6808d2e7a117
2012-08-29 00:35:39 +02:00
Reedy 427e6849ae Bug 36486 - CategoryTree: get_object_vars() expects parameter 1 to be object, null given
Change-Id: Ibdf188724bee192dceb96d7e55ebe3d1e106facf
2012-05-09 20:01:22 +01:00
Sam Reed d0577cc9c3 Bug 35156 - Harmonise spelling of getArticleID() and getArticleId()
Mass change ->getArticleId() to ->getArticleID()
2012-03-11 19:04:37 +00:00
Krinkle 1da2e2788c [CategoryTree] Fix "bad json errors on options= {":" that are populating wmf error logs
* Only occurred on category trees produced by <categorytree>. The category trees dynamically created when expanding the [+] toggle in the subcategory list on a category page were not affected (since those don't have data-ct-options attributes and thus JS uses the default via mw.config.get( 'wgCategoryTreePageCategoryOptions' ), which wasn't double escaped)
* escapeTagsOnly escapes & to &quot;
* Xml::openElement does normal attribute escaping, assuming unescaped input

Before:

<div class=" CategoryTreeTag" data-ct-mode="0" data-ct-options="{&amp;quot;mode&amp;quot;:0,&amp;quot;hideprefix&amp;quot;:20,&amp;quot;showcount&amp;quot;:false,&amp;quot;namespaces&amp;quot;:false}">

<div class="CategoryTreeTag" data-ct-mode="0" data-ct-options="{&quot;mode&quot;:0,&quot;hideprefix&quot;:20,&quot;showcount&quot;:false,&quot;namespaces&quot;:false}">
2012-03-02 00:18:09 +00:00
Sam Reed e8f7e97e51 Don't explicitly use Services_JSON, use FormatJson 2012-03-01 01:17:55 +00:00
Sam Reed 079968308b Documentation, stylize, remove some global dependencies 2012-02-09 01:23:31 +00:00
John Du Hart 4383d6d598 Followup r98500, fixes flash of unstyled content 2012-02-08 14:07:10 +00:00
Sam Reed 954bac92b0 Documentation
Wrapping up some long lines
2012-01-14 15:27:30 +00:00
Brian Wolff af663ef1b2 (follow-up r103260) fix if condition per Umherirrender, change variable name to something less confusing per Nikerabbit. 2011-11-16 12:35:40 +00:00
Brian Wolff 9bd0bc3daa (follow-up r100023; bug 32438) $pagesCount is total number of members a category has, not the number that are "normal" pages. 2011-11-15 23:35:52 +00:00
Amir E. Aharoni 230fffed11 Bug 29357: CategoryTree should have built-in localizable support for pretty Categorytree-member-num.
Added the messages:
* categorytree-num-categories
* categorytree-num-pages
* categorytree-num-files
* categorytree-num-empty

Added documentation for all of them and for categorytree-member-num and also localized them for Hebrew.

Rewrote the part that uses categorytree-member-num to automatically create a comma-separated list of relevant member counts. categorytree-member-num will still be used the same way if it is customized on wiki.
2011-10-17 11:35:57 +00:00
John Du Hart d7f17e8a37 Followup r98563, don't need those messages anymore 2011-09-30 21:10:08 +00:00
John Du Hart 8e3523c626 Followup r98500, conversion of the Javascript to use jQuery fully. It also makes the Javascript work outside of debug=1 (oops)
There's a couple of WTF moments in the code, this is really due to some issues with the PHP side of stuff. It really needs some TLC but for right now it works, I'll come back to it before 1.19 and clean it up.
2011-09-30 21:08:28 +00:00
John Du Hart e77ae5449b Basic ResourceLoader conversion, jQuery conversion and API use will come soon 2011-09-30 02:51:53 +00:00
Brion Vibber c1f82b9325 * (bug 30834) Fix for incorrect cache handling of output language in CategoryTree ajax requests
Memcache key was not taking UI output language into account, and thus could serve you a cached record in another language from what should have been rendered for you.
Added UI language into the cache key, so they no longer interfere with each other.
2011-09-09 21:08:50 +00:00
Robin Pepermans 47dcfb861f (bug 28349) CategoryTree: Number of pages in a category is displayed incorrectly after an LTR char in an RTL wiki -> add a direction mark 2011-06-24 19:53:15 +00:00
Sam Reed 7dd2a80469 Swap else if for elseif
Trimming trailing whitespace also
2011-06-17 16:25:46 +00:00
Brion Vibber 111b83a16b * (bug 26856) Fix category tree AJAX expansion and inline use for category names that match namespace names ending in colon
The previous check that checked for the alt-namespace case caught things for 'Category:Wikipedia:Foo' but not for 'Category:Wikipedia:', where the 'Wikipedia:' alone doesn't return a legit title.
(Conceivably, Title::newFromText() should actually handle this case when an alt ns is given, should be examined later.)
2011-02-13 22:19:18 +00:00
Sam Reed e1e45855eb Method documentation. Remove freeResult call 2011-02-11 11:28:58 +00:00
Roan Kattouw 05e349be6e Clean up query generation in CategoryTree a little bit 2011-01-20 19:37:22 +00:00
Roan Kattouw 9f50a3069a CategoryTree: Force cl_sortkey index. This is a backport of the live hack committed in r67176 2011-01-20 18:55:06 +00:00
Sam Reed a39def326d Conditionals in loops to foreachs 2010-10-29 21:30:20 +00:00
Platonides 57d025e067 Replace getPageRenderingHash with $wgContLang->getExtraHashOptions() + $wgRenderHashAppend
as discussed in bug 20040
2010-10-17 17:24:09 +00:00
Platonides 19904b5851 Use wfMemcKey instead of manually building the memcache key.
Not only is this more elegant, the former had collisions on wikis with different prefixes.
2010-10-10 14:11:25 +00:00
Aryeh Gregor 064ce8137b Adapt CategoryTree to the new schema
This should obsolete $wgCategoryTreeMaxScanRows, added in r67179, so I
removed it.  Note that I only tested with very basic usage, since I
don't quite understand all the complicated things this extension can do,
and some code paths are certainly going to remain inefficient, since
arbitrary namespace filtering seems possible here (at least
renderChildren() has support for it).  However, clicking the little plus
sign on category pages should now scan only as many rows as are actually
used, so no limit should be necessary.

Sorting is now by cl_type, cl_sortkey instead of cl_sortkey.  This
change has to be made to all users for efficiency, since the old index
was dropped.  It means the sort order might be somewhat unexpected in
some cases, but for basic CategoryTree use it makes no difference, since
all the results have cl_type = 'subcat' anyway.

Fixes bug 23682, I think.
2010-08-16 21:57:49 +00:00
Aryeh Gregor e2300181e5 Save up to 200 queries per click in CategoryTree
Remember, people: if you use Titles that don't have all the proper
fields prefetched, LinkCache will fetch them for you, one by one.
Fetching page_id, page_len, page_is_latest, and page_latest will make
everything work without needless queries.
2010-08-16 21:37:26 +00:00
Aryeh Gregor 6873b490ef Use DB abstraction CategoryTree::renderChildren()
Formerly pieced it all together with strings.  This seems not to have
broken anything for basic usage, but I didn't test thoroughly.  Also
fixed some random style errors and unused variables while I was there.
2010-08-13 22:38:00 +00:00
Sam Reed 7beb050639 More wrong static method calls fixed 2010-07-26 13:30:31 +00:00
Sam Reed 78d6b8163d Remove some more unused globals
Kill a couple of other unused variables
2010-07-25 17:12:50 +00:00
Siebrand Mazeland ebff4d349b Replace Title::makeTitle[Safe]( NS_SPECIAL, 'x' ) with SpecialPage::getTitleFor ( 'x' )
And a few other minor changes.
2010-06-08 19:30:48 +00:00
Alexandre Emsenhuber 261d68c15a Big changes to extensions' documentation:
* changed all @addtogroup to @ingroup
* added some @file where needed
* changed some @package/@subpackage to @ingroup
2010-06-06 15:12:22 +00:00
Daniel Kinzler b719db957d PHP compatibility: 5.3.1 is picky about pass-by-reference. Restrict use of &$foo to actual output parameters. This should probably be done for the entire code base. 2010-06-02 09:10:09 +00:00
Roan Kattouw 833afe31a3 CategoryTree: Backport r67183 from 1.16wmf4 2010-06-01 14:28:08 +00:00
Tim Starling adca6de0aa * Per Aryeh's suggestion on CR r66987, treat categories larger than a certain size as empty. The visual presentation is not perfect, but it needs some more aggressive treatment than what I can give it right now.
* Get counts into local variables, to make the code slightly more compact.
2010-06-01 08:58:04 +00:00
Tim Starling 3c3fdfde1a * (bug 23682) Don't allow people to expand subtree when it's known to be empty, this is inefficient.
* Fixed a bug causing the "+" link to be shown even when the number of subcategories is zero, due to the DBMS returning a string instead of an integer, causing triple-equals comparison to fail.
2010-05-28 02:15:44 +00:00
Siebrand Mazeland bc388d6493 * stylize.php, trailing whitespace removed, indentation updated
* removed CategoryTree::init(). Loading messages explicitly is no longer needed
* removed commented out code bits.
2010-04-20 22:00:34 +00:00
Daniel Kinzler 8ca7b829d1 fix bug 20040: add PageRenderingHash to cache key to prevent cache mixup. Patch by Derk-Jan Hartman 2010-04-06 21:46:46 +00:00