[TWIG] Restructure user settings template, making it much easier to use and extend

This commit is contained in:
2021-12-08 17:53:29 +00:00
parent 6627006e61
commit d52a043705
9 changed files with 107 additions and 158 deletions

View File

@@ -61,15 +61,16 @@ class ProfileColor extends Plugin
* @throws RedirectException
* @throws ServerException
*/
public function onPopulateProfileSettingsTabs(Request $request, array &$tabs): bool
public function onPopulateSettingsTabs(Request $request, string $section, array &$tabs): bool
{
// TODO avatar template shouldn't be on settings folder
$tabs[] = [
'title' => 'Color',
'desc' => 'Change your profile color.',
'controller' => C\ProfileColor::profileColorSettings($request),
];
if ($section === 'colours') {
$tabs[] = [
'title' => 'Profile Colour',
'desc' => 'Change your profile colour.',
'id' => 'settings-profile-colour-details',
'controller' => C\ProfileColor::profileColorSettings($request),
];
}
return Event::next;
}