[TWIG] Remove kludge event TwigPopulateVars

This commit is contained in:
2021-09-18 07:27:17 +01:00
parent fda998e335
commit 67d62cf37b
15 changed files with 112 additions and 147 deletions

View File

@@ -71,22 +71,22 @@ class ProfileColor extends Plugin
* @param array $vars
*
* @return bool hook value; true means continue processing, false means stop.
*/
public function onStartTwigPopulateVars(array &$vars): bool
{
/*$vars['profile_tabs'][] = [
'title' => 'Color',
'desc' => 'Change your profile color.',
'path' => 'profilecolor/profilecolor.html.twig',
];*/
if (Common::user() != null) {
$color = DB::find('profile_color', ['actor_id' => Common::user()->getId()]);
if ($color != null) {
$vars['profile_extras'][] = ['name' => 'profilecolor', 'vars' => ['color' => $color->getColor()]];
}
}
return Event::next;
}
*
* public function onStartTwigPopulateVars(array &$vars): bool
* {
* /*$vars['profile_tabs'][] = [
* 'title' => 'Color',
* 'desc' => 'Change your profile color.',
* 'path' => 'profilecolor/profilecolor.html.twig',
* ];
* if (Common::user() != null) {
* $color = DB::find('profile_color', ['actor_id' => Common::user()->getId()]);
* if ($color != null) {
* $vars['profile_extras'][] = ['name' => 'profilecolor', 'vars' => ['color' => $color->getColor()]];
* }
* }
* return Event::next;
* }*/
/**
* Output our dedicated stylesheet