HomePhabricator

WikidataPageBanner hook changes and serverside toc

Description

WikidataPageBanner hook changes and serverside toc

Remove addDefaultBanner(ArticleViewHeader hook) and add OutputPageParserOutput
hook. The banner is now generated only at the last stage, i.e. in
BeforePageDisplay hook. This is being done so that all properties required for
banner are available before generating it, such as a TOC. The custom banner is
handled by setting banner parameters in the parser function, which are then
propagated to addBanner(BeforePageDisplay hook), where banner is generated. The
hook checks if banners parameters have been set and generates banner from them,
else adds a default banner. The banner is added using prependHtml() which adds

html content at the beginning of main content, i.e. div#content. prependHtml()
is a replcement of addHTML() earlier used in ArticleViewHeader as it prepends
banner html just before main body of page, where it should occur.

Additional advantage of this is that properties such as [[Category:foo]] can be
passed in parser function as return which will be parsed and added to page as
banner property on that page. The only disadvantage of this approach, is that
parser function will not determine banner position.
Rename 'loadModules' to 'addBanner' and fix its documentation.
Phpunit tests modified as per new strucutre.
Move toc to server side as a banner parameter.
Split toc module in style and script modules and style module at top and script
at bottom.
Hide banner toc in Skin Minerva.

Bug: T103569
Change-Id: Iff1ac56fdb3f691f0cabe31e4e34aa78e5ac48d8