Extension:IntegratedProfiles/Hooks/IntegratedProfilesRenderTab
Appearance
For more information about attaching hooks, see Manual:Hooks.
For examples of other extensions using this hook, see Category:IntegratedProfilesRenderTab extensions.
Fills HTML for a tab when it is active (requires onIntegratedProfilesGetTabs to be called first). Intended for extensions, but can work elsewhere.
Details
[edit]$tab_id: Astringmatching an ID registered via IntegratedProfilesGetTabs. Cannot be'about'or'contributions'&$html: Mutable panel HTML.$profile$context
Usage
[edit]/**
* Render a custom tab panel with IntegratedProfiles that has been registered via IntegratedProfilesGetTabs.
*
* @param array<string,mixed> $profile
*/
public function onIntegratedProfilesRenderTab( string $tab_id, string &$html, array $profile, IContextSource $context ): void {
if ( $tab_id !== 'customtab1' ) {
return;
}
$user_id = (int)( $profile['user_id'] ?? 0 );
if ( $user_id <= 0 ) {
return;
}
$context->getOutput()->addModuleStyles('ext.MyExtension.styles');
$html = /* ... */;
}