Pass a valid key to makeLink rather than an integer (index)
which may result in an exception.
Bug: T286040
Change-Id: Ic69ec102caec982e65e264f5812ac15df5168008
This is going to be needed for skins that support icons as
in the new mw-ui-icon implementation, labels must be wrapped
in spans.
This is made a skin option so skins can control.
It will be used in Vector (Ia2d2c86e61341b9900f9ac337ddd763252e0515f)
Bug: T191021
Change-Id: I2bfaebf5d766240b57d7baed445001a007634839
The `class` property on menu items applies to the <li> tag however
in the case of the personal tools menu for historic reasons it applies
to the anchor tag. To bring these in line, a new optional parameter
is added that is utilized inside SkinMustache. Given the method is
final we do not need to worry about skins extending this behaviour.
This is needed for the mw-ui-icon change as we want to separate
the <a> tag with the mw-ui-icon class from the padding of its container
on the <li> item.
This also makes use the "new" class is added to the userpage link rather
than the list item by using the link-class property. This does not impact
existing skins as the impact is the same before and after this change.
This will temporarily break skins making use of user-menu, but this was
introduced in 1.37 which has not been released yet, so it's okay to
introduce breaking changes. It is currently only used by Vector
Bug: T285960
Change-Id: If399dfff9bbdd3b03b2ca702face3ec5164bef11
This is a breaking change, but I've reviewed all usages
and there's nothing that requires full User object to be
returned. Maybe it's too bold, following the deprecation
process is not too hard either.
Change-Id: Id22580945f594d7e0de533226f6c374a7a97fe1e
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.
Bug: T284950
Change-Id: I9a4806047f8d31d59a00e02145906672b85c004c
The SkinTemplateTabAction hook was marked as deprecated in MediaWiki
1.35.
Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].
[0] https://codesearch.wmcloud.org/search/?q=SkinTemplateTabAction
Bug: T284950
Change-Id: I998bf8ffe6be43ad3eb38b1a9388a35aa94d7685
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.
Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].
[0] https://codesearch.wmcloud.org/search/?q=SkinTemplatePreventOtherActiveTabs
Bug: T284950
Change-Id: I37c5bdcc8875a23798f641161e53be3e4d073d7d
Per T284594, adds an icon key/value for the following personal url menu
items so that it is easier for skins to use the appropriate icon:
* login
* logout
* mytalk
* preferences
* watchlist
* mycontris (user contributions)
* anontalk (talk page for anon user)
* anoncontribs (contributions for anon user)
* createaccount
* userpage
Bug: T284594
Change-Id: I95f2a0a01134f2c3dfc22083be66c99de26b530f
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
To mirror the html-after-portlet template variable, it will
be possible for skins to define HTML before a portlet. For now
this can only be modified by skins.
Depends-On: I32586a379cbacaad5cfb361facf79c01e982818a
Change-Id: Ia64e7d4009cf303494ff455e1596286bcca811d9
Factors out logic that's responsible for assembling data for the logout
link in a public SkinTemplate::buildLogoutLinkData function.
This function is required by the new version of the Vector skin to
reposition the logout button outside of the personal tools menu.
Bug: T281791
Change-Id: If82a736e37174aaadd0ff07019a1fae3759a9e51
- Update $content_navigation in SkinTemplate::buildContentNavigationUrls() to include a new top-level menu.
- Exclude user-interface-preferences menu from content navigation in legacy skins.
- Add method makeSkinTemplatePersonalUrls() to SkinTemplate to build personal urls.
- Rename method to injectLegacyMenusIntoPersonalTools() to add legacy menu items.
- Update unit test for renamed method injectLegacyMenusIntoPersonalTools().
Bug: T282196
Change-Id: If4805e5186756056afcd31d21919e907a7782ce8
Sysadmins could unset the entire copyright array in FooterIcons.
Might as well make sure it exists at all before checking if it has
something usable. Also simplifies related testing.
Change-Id: I56e06d564a9d60851d10e69065fd70dd51025bd2
1) Rename content-parser-output to `content-body`
Widen the scope of this module to apply to anything that can be rendered
as the article body. Improve the documentation on what is allowed here.
For early-adopter skins already using content-parser-output,
map the feature to the new name and add tests.
2) Reclaim the `mw-body-content` class for result of
SkinTemplate::wrapHTML
The `mw-body-content` has been used in skins to wrap various elements.
Going forward we will use it to wrap any HTML content generated by
OutputPage.
See dependent patches, which we're not directly depending on to avoid
a CI gremlin:
- I90d85c21f4a62e6697f24e3ce388445a0a53c2b0 (MonoBook)
- I11242e243c9a529b72972089af9ac2a8c906331a (Modern)
- I87942c60e62f6f14acdfeaa1836ace4eac9252ac (CologneBlue)
- I4c1b15d90bacbc9b13782a1d8f52e838ce8ecd83 (Vector)
Bug: T279388
Change-Id: I3a91b294fcb3724cd46743e497dff723de0490a6
This was really badly documented. Monobook and Timeless menus are generated using
the old BaseTemplate methodology. These new keys need to be unset to keep
compatibility. This code probably needs refactoring, but for now an explanatory
comment should help avoid this happening again.
Bug: T282646
Change-Id: I050a03abd90a94138dd6591d6f92af7e1515a9c9
This reverts commit cefb0c4b35.
Reason for revert: This creates some problems in a new mode of Vector
we're testing. The fix for the originally reported problem is simpler
and a patch will follow.
Change-Id: I78ea52ac79dd08f053c3920af4a882b8446c4ed4
In all these cases the property is unconditionally set in
the constructor. The extra initialisation is effectively
dead code and an extra source of errors and confusion.
Change-Id: Icae13390d5ca5c14e2754f3be4eb956dd7f54ac4
This reverts commit 5c7a0f84f2.
Unannounced breaking change for skins, causes weird tab to be
added on MonoBook and Timeless skins.
Bug: T276561
Bug: T282646
Change-Id: I35a7b9ded2be5401294d74fd59269b874793ad4c
This check is now in Skin::getRelevantUser() method itself and
so is pointless to repeat.
It was supposed to be removed in I177cd83 but was restored
unintentionally in one of the rebases
Follow-up: I177cd83a9c4f87c27a63d8f530c40895d0f3f5dd
Change-Id: Ic1758775ecd6992e162f1e7461a9ae7afdc9bcd0
We filter out icons with no images, which includes empty icon arrays,
already. Let's also remove their containers if nothing winds up inside
them so we're not returning any empty container arrays, either.
Bug: T278266
Change-Id: If9bfb764b61a77e71ca7f374fa67a56ac89c799f
Inside buildPersonalUrls method, replace personal_urls variable with method call to build personal page link. Add "user-page" menu to content navigation. This patch is a dependency for a corresponding patch in the Vector repo which needs the new "user-page" menu item to update the personal toolbar based on a feature flag.
Bug: T276561
Change-Id: If4e143aada711d210ae45d33b97a6be0685b6a41
Most needed for moving forward with the removal of uses
of the Revision class, and remove User::getNewtalk at
the same time to be consistent. All of this code was
already hard deprecated in 1.35.
- User::getNewtalk
- User::getNewMessageLinks (could return Revision objects)
- UserRetrieveNewTalks hook (could return Revision objects)
- User::getNewMessageRevisionId (used ::getNewMessageLinks)
- User::setNewtalk (accepted Revision object parameters)
Bug: T247143
Bug: T277511
Change-Id: Ib4fd1e4cbc5ba1497658190b6c6ea3c6a5dc97f0