[PLUGINS][ProfileColor] Re-organized plugins templates and assets. ProfileColor plugin fixed.

This commit is contained in:
2021-09-25 11:17:56 +01:00
parent 765cf66ff2
commit 57b94af9f6
28 changed files with 72 additions and 103 deletions

View File

@@ -60,7 +60,7 @@ class ProfileColor
$pcolor = DB::find('profile_color', ['actor_id' => $actor_id]);
$color = '#000000';
if ($pcolor != null) {
$color = $pcolor->getColor();
$color = $pcolor;
}
$form = Form::create([
@@ -73,17 +73,17 @@ class ProfileColor
if ($form->isSubmitted() && $form->isValid()) {
$data = $form->getData();
if ($pcolor != null) {
if ($pcolor !== null) {
DB::remove($pcolor);
DB::flush();
}
$pcolor = Entity\ProfileColor::create(['actor_id' => $actor_id, 'color' => $data['color']]);
$pcolor = Entity\ProfileColor::create(['actor_id' => $actor_id, 'profile_color' => $data['color']]);
DB::persist($pcolor);
DB::flush();
throw new RedirectException();
}
return ['_template' => 'profilecolor/profilecolor.html.twig', 'form' => $form->createView()];
return ['_template' => 'profileColor/profileColorSettings.html.twig', 'form' => $form->createView()];
}
}