Commit graph

110 commits

Author SHA1 Message Date
Umherirrender 8e4bff8976 Add phpcs and make pass
Change-Id: I52845fc95b53eca5149a947dfc6a1b39100da97b
2017-05-30 20:23:16 +02:00
Sébastien Santoro 26affac7f8 Migrate to extension registration
We keep constants in CategoryTree.php extension loader to maintain
backwards compatibility with the MediaWiki configuration. It's expected
users will migrate from them when they switch to wfLoadExtension.

Bug: T87888
Change-Id: If67d0fe2ff758c7fd41386d04f5c0839c8c665a1
2016-08-06 00:52:47 +00:00
Sébastien Santoro 070e6af90c CategoryTreeMode and CategoryTreeHidePrefix constants classes
The extension CT_* defines are replaced by class constants.

We currently keep the former defines in CategoryTree.php,
to help to set the default configuration. When the code
will be migrated to use the extension registration, we'll
remove the defines.

Bug: T87888
Change-Id: I59e6b9319fd5130c51a23f21ea81d4dbf3f28b8e
2016-04-02 01:50:18 +00:00
Sébastien Santoro fee5d0dc01 Move functions outside extension entry point
The extension entry point contains several callback functions, and an
helper function. We move them respectively to the new CategoryTreeHooks
class and to the existing CategoryTree class.

This change is intended to prepare the extension transition to the new
registration system.

Bug: T87888
Change-Id: Ic6ddd6f0dc51e90391f2b8d3c4450683ed67c018
2016-04-02 01:49:43 +00:00
Alex Monk 680cdd688a Use an API module instead of the old (to be removed) ajax functions
Also removes some stuff that appears unused.
Caching depends on Ia18874c9

Bug: T92788
Change-Id: I4d106d8fbfd799a15ef3f8eda06c437b234ec218
2016-01-25 18:26:40 +00:00
PranavK a92aab26dc Add license to $wgExtensionCredits
Bug: T123943
Change-Id: I9ec064539b7ad84ce930a0626aa8a35738917338
2016-01-24 08:46:16 +05:30
umherirrender ffa6e0cc53 Replace deprecated $wgSpecialPageGroups
$wgSpecialPageGroups is deprecated since 1.21
override SpecialPage::getGroupName instead

Change-Id: Id783a062acb023b80704c2e24aaf8736f7cd75e7
2015-05-16 13:20:47 +02:00
Gilles Dubuc e349422043 Explicitly define module position
Style modules currently added through addModuleStyles default
to being in the head ("top" position). This is an unhealthy default,
since only critical styles that are needed at pageload should be
in the head. In order to be able to switch the default to "bottom",
existing module positions have to be defined explicitly.

Bug: T97410
Change-Id: I7ce807e7043b8dc059fe8211dc01396c9b67e1d7
2015-04-28 15:32:06 +02:00
Timo Tijhof 8d7de84017 Register CategoryTreeMagic from global scope instead of setup
Follows-up I32357244c013a2370f14f.

I don't know how or why, but this late way of registering magic
words from within an extension setup function is sometimes
causing people's install to fatally crash on:

> Exception from line 318 of mw/includes/MagicWord.php:
>   Error: invalid magic word 'categorytree'

Just move it out of there into a plain and simple registration.

The parser function itself is still registered conditionally.

Change-Id: I07df5de5f39ce0ad029ef0152d126e620308ba25
2014-06-06 09:45:02 +00:00
Siebrand Mazeland 267d4d94e9 Fix undefined variable $dir
* Follow-up to 7f440c3f72.
* Use __DIR__ everywhere.

Change-Id: If4ff55920207ba69dc4d981a68598e0a1eb029e4
2014-04-07 20:13:52 +02:00
jenkins-bot 66709b8766 Merge "Move $wgExtensionMessagesFiles['CategoryTreeMagic'] into $wgExtensionFunctions" 2014-04-07 17:26:09 +00:00
Leaves in Motion 8a210414db Use hooks instead of $wgOut when $wgCategoryTreeForceHeaders is set
Previously, $wgOut was used when $wgCategoryTreeForceHeaders was set and
a hook was used when it was not.
This change makes sure there is always a hook used with an OutputPage
instance. It fixes bug 57651.

Using $wgOut the rebuildFileCache.php maintenance script would generate
pages without JavaScript and CSS for CategoryTree when
$wgCategoryTreeForceHeaders was set (for example, when the sidebar was
in use).

Other uses of $wgOut in the CategoryTree extension seem to be less of an
issue because when there is a CategoryTree on a page, those pages seem
to be excluded from caching. (But fixing those would be nice
nonetheless: it may prevent other bugs in the future).

Bug: 57651
Change-Id: I0ee66d38755e255c5597db7a237a176039025fae
2014-04-05 19:03:41 +00:00
Reedy 7f440c3f72 Move $wgExtensionMessagesFiles['CategoryTreeMagic'] into $wgExtensionFunctions
Extension config based on values of config values isn't going to work
in the global scope. The user won't have set it yet.

Though, is there any reason we don't just loads this always?

Change-Id: I32357244c013a2370f14ff5d36427aa3385be444
2014-03-28 03:07:01 +00:00
Siebrand Mazeland 1f6df56a60 Migrate to JSON i18n
Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php
with shim.

Add a file to .jshintignore to not make Jenkins block on something that's
not related to this patch set.

Change-Id: I9331d328746281a2eb7ec1317d557e8fd7931d74
2014-03-25 14:55:24 +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
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 a9690cc876 Revert "CategoryTree: Move stuff into the extensionFunction"
This reverts commit ba481a2adb
2012-06-22 16:08:52 +00:00
Timo Tijhof ba481a2adb CategoryTree: Move stuff into the extensionFunction
* So that local settings are actually used, regardless of order.
  wgExtensionFunctions should be early enough still.

Change-Id: I38aa542f3e1940398c3a80927cf3de44790c6b7b
2012-05-29 23:29:09 +02:00
Benny Situ 593a93b07f attempt to fix bug33989 - fix the mode parameter in api call 2012-02-10 23:41:49 +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
Siebrand Mazeland 328484f6d2 Bye, bye $wgExtensionAliasesFiles (deprecated in 1.16). 2011-12-25 23:09:26 +00:00
Brion Vibber 5ceddc1fd6 Update a butt-ton of extension about URLs to point to https://www.mediawiki.org/ 2011-12-13 23:49:33 +00:00
Sam Reed 3341d45b88 Oct 5 00:32:16 10.0.2.175 apache2[351]: PHP Warning: Missing argument 2 for efCategoryTreeAjaxWrapper() in /usr/local/apache/common-local/php-1.18/extensions/CategoryTree/CategoryTree.php on line 204
Already been fixed in 1.17wmf1 before, and now in 1.18wmf1
2011-10-05 00:37:15 +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
Sam Reed d9edab47c8 Fix double credits, don't define multiple times 2011-04-04 17:50:28 +00:00
Sam Reed f99b2aa990 Remove some old codepaths
Kill unused globals
2011-03-18 13:50:00 +00:00
Sam Reed 68c90be0a0 Another big cull on unused variables and such 2010-10-29 21:55:29 +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
Matěj Grabovský a6c63efe65 Removed description in $wgExtensionCredits where descriptionmsg was used 2010-08-10 15:27:44 +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
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
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
Siebrand Mazeland b8648c8661 * Remove $wgExtensionCredits['description'] where $wgExtensionCredits['descriptionmsg'] present. This feature was introduced in MediaWiki 1.12, and 'description' is not used if 'descriptionmsg' is present.
* Random indentation updates and trailing whitespace removed
2010-02-22 23:41:51 +00:00
Sam Reed 5d1c27e51a Mass convert NULL -> null. Left strings and comments alone, obviously.
As per ^demon's suggestion
2010-01-06 21:24:10 +00:00
Chad Horohoe 1db4e16297 Nuking fallback code for MW < 1.12 in most extensions (there's like 5 or 6 left I haven't done). Couple of points:
* 1.11 and below aren't supported anymore, so we don't need to be maintaining back-compat code for it anymore. This is why we branch extensions
* The vast majority of these were using $wgParser. This defeats the purpose of ParserFirstCallInit...allowing you to use parsers other than $wgParser. All these extensions now work in any instance of the Parser, not just $wgParser
2009-09-04 22:22:12 +00:00
Siebrand Mazeland cd5deee70b * Babel, CategoryTree, MagicNoNumberedHeadings, RegexFunctions and SmoothGallery: new style magic words
* MagicNoNumberedHeadings: add extension description in i18n file, reindent
* bump versions where applicable
2009-08-14 11:25:54 +00:00
Siebrand Mazeland f30fa2030e * Rename "<ExtName>.i18n.alias.php" to "<ExtName>.alias.php"
* Add support for ConfirmEdit and Mibbit special page localisation to Translate
2009-05-24 22:12:11 +00:00
Shinjiman 0e556756e2 * (bug 18242) Show the Subversion revision number per extensions in Special:Version (currently applied on some extensions to get the entries file) 2009-04-26 05:22:33 +00:00
Chad Horohoe 4ff8be6829 Big commit. Removing svn-version and svn-date from extensions. Per the list, these versions do not give valuable information and are often wildly inaccurate. 2009-03-26 17:39:49 +00:00
Andrew Garrett 47d75cfb22 Bump style version 2009-03-09 11:54:39 +00:00
Daniel Kinzler 85519eadd0 fix squid caching: use $wgSquidMaxage instead of $wgSquidMaxAge 2009-02-04 11:20:39 +00:00
Andrew Garrett 41afc38c73 Revert "Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions."
Uses $dir in extension files, and assumes that it remains unchanged in require_once( 'maintenance/commandLine.inc' ).
In fact, it is likely that '$dir' will be set when setting up command-line, as some extensions will use the same var.

Recommended fix: Use $CentralAuth_dir, $EmailPage_dir, etc.
2008-11-30 03:15:22 +00:00
Siebrand Mazeland 793882aeb4 Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions. 2008-11-26 23:17:15 +00:00
Brion Vibber ed0590ed5e Tweak to r43493 -- trim whitespace on the inside right side of the quote as well as the left (was incorrectly re-stripping outside the quote, where we already stripped whitespace) 2008-11-14 23:40:36 +00:00
Raimond Spekking 06ebf14220 Bump version number for changed CSS per r43492. 2008-11-14 16:41:30 +00:00