Contrary to what this comment says, this extension is not all-AJAX.
If you disable JavaScript in the browser, the subcategory counts
still show, so it is about half JS, half PHP. The JS part is the little
triangle you can click to load the list of subpages.
Change-Id: Ib25a13c57656b832e079627301f45b94bbd7e814
As having href causes arrows to be clickable before JavaScript
handler be loaded.
And since that disables visited logic, let's remove it.
Change-Id: Ice4c979d020342890fffd587bb5bee88fcc2a1ae
In 8e51ea4e3a CategoryTreeFunctions.php
was renamed to includes/CategoryTree.php. The class name was already
CategoryTree.
Change-Id: I2734c92810df0f653ae1ea402a149e42e7be08cb
The attribute data-ct-options already contains the mode and attribute
data-ct-mode is just redundant. The attribute data-ct-mode is now not
needed anymore and removed from the rendered HTML.
Change-Id: If261f3cdab6c55243e80dc2ef3caa884538b02bc
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.
Bug: T376276
Change-Id: I40bb7a0a02aaa467cbf0ae182adf5601ccbcb58e
I believe having arrows linked to the actual pages can
be much more useful than linking to '#' of the same
page. Linking to the correct page makes user to notice
if the page is already visited also using color of
the arrow.
If we didn't like link visited logic to be not used we
could've used a different link rather than color of links
and going makes us able to :visited logic of
If8b2b45b24351ee5c8fc9ee1380563f5d5b88678 also.
Personally however I'm in believe that having a useful
link that can be opened on a different tab using
Ctrl (or long click on phones) is always more useful.
Change-Id: Ib56fad0b711853d67b2d55617b36deff56141c74
CategoryTree::makeTitle also makes a trim and an early return.
A trim on the return value of renderChildren() is not needed.
Change-Id: I1fc2705277491797eb6c0d0900152b63913ca875
This change avoids a super category expand button on not existing
categories.
This change even avoids loading the modules if there are no valid
categories.
Change-Id: I38a2b49aaef7cf46d9f89e1cc9fd65e2382155f5
* Add PHP type hints where possible.
* Remove @var, @param and @return if redundant to type declaration
* Remove redundant type conversions which are now enforced by type
hints.
* Enforce that decodeBoolean returns only a bool.
Change-Id: I8da84ed4dc778dd9d84f8d9eec0a399f5ed26405
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I51931c3aab6aa1e5bc77b3cc83b8014cf557ff75
* Mark $mOptions as private. There is no external reference.
* CategoryTree::makeTitle don't return false. A check for false is not
needed.
* A class attribute should not start with a space.
* $title->isExternal() is equivalent to $title->getInterwiki() !== ''.
* Use $title->inNamespace( NS_CATEGORY ) instead of
$title->getNamespace() === NS_CATEGORY.
Change-Id: Iddad84ff5a18080d1216346ec2a906c955a644a4
Core now provides all-member count separately with type guarantee.
Also bump core requirement to >= 1.38.0
Change-Id: I2b489e690ad05462a553e424bd9495593a8d2b1b
* Use ' instead of ".
* Use === instead of ==.
* Use !== instead of !=.
* Use explicit type cast.
* Combine array assignment.
* Use null coalescing operator.
Change-Id: Ic2fe4f62556df77262915b5bcbe1b11a1d907e6d
This change outputs the not found category as plain text and prevents
parser processing of the category name like '''bold''' or ''italic''.
This affects the root category of the category tree in the sidebar
like on
$wgCategoryTreeSidebarRoot = "Lista d''e Paise d''o munno"
for a situation without parser and
{{#categorytree:Lista d''e Paise d''o munno}}
or
<categorytree>Lista d''e Paise d''o munno</categorytree>
in the content for situations with parser.
A separation for with and without parser is not needed anymore.
Problem described in T18744 which was the reason for change r49471
(9700e2d5) is not reproducible.
This change also prevents that the value in the parameter `target` on
Special:CategoryTree gets interpreted as wikitext and outputs the value
with an output encoding.
Special:CategoryTree?target=B%27%27%27o%27%27%27ld%20un%3Cu%20onclick%3d%22alert(%27XSS%27)%22%3Eder%3C/u%3Eline
was rendered as
B<b>o</b>ld un<u>der</u>line
and is now rendered as
B'''o'''ld un<u onclick="alert('XSS')">der</u>line
The parser prevented already JavaScript injection, so there was no
security issue.
Change-Id: I592b23ba965c15b81a2f97686161a4d590331c87
trim() would always return a string, even with null as input
Keep the strval to make visible that this gets unsafe input
Change-Id: I6ff0ce307f6a8ac21669d6db693e5ff27767a55d
This allows better to style the buttons.
The complicated CSS selector for the direction supports a categorytree
in the user interface language like in the sidebar or on
Special:CategoryTree and in the content language like on category pages
and with <categorytree> in the content.
The CSS selector :dir( rtl ) would be a short version for this but it is
currently only supported by Firefox:
https://developer.mozilla.org/en-US/docs/Web/CSS/:dir
Bug: T288910
Change-Id: Ibfb0cb28f0086fb1b7d0997be2246bc120eea85e
Special:CategoryTree shows wrong link to parent category that containing string that need percent-encoding.
Changed getPartialURL() to getDBkey() on CategoryTree.php. getPartialURL() returns a percent-encoded URL and getDBkey() returns no encoded URL.
Bug: T253621
Change-Id: Idffb8ffece88a1d726075ffee9d64e6e05ed4e52