diff --git a/plugins/ProfileColor/Controller/ProfileColor.php b/plugins/ProfileColor/Controller/ProfileColor.php index afe16f2efc..dcc7118cf4 100644 --- a/plugins/ProfileColor/Controller/ProfileColor.php +++ b/plugins/ProfileColor/Controller/ProfileColor.php @@ -26,9 +26,7 @@ use App\Core\Form; use function App\Core\I18n\_m; use App\Entity\ProfileColor as PColor; use App\Util\Common; -use App\Util\Exception\ClientException; use App\Util\Exception\RedirectException; -use App\Util\Exception\ServerException; use Symfony\Component\Form\Extension\Core\Type\ColorType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; @@ -47,12 +45,11 @@ use Symfony\Component\HttpFoundation\Request; class ProfileColor { /** - * Add/change cover + * Add/change profile color * * @param Request $request * - * @throws ClientException Invalid form - * @throws ServerException Invalid file type + * @throws RedirectException * * @return array template */ @@ -66,11 +63,8 @@ class ProfileColor $color = $pcolor->getColor(); } - //print_r("STORED: " ); - //var_dump($color); - $form = Form::create([ - ['color', ColorType::class, ['data' => $color, 'label' => _m('Profile Color')]], + ['color', ColorType::class, ['data' => $color, 'label' => _m('Profile Color'), 'help' => _m('Choose your Profile Color')] ], ['hidden', HiddenType::class, []], ['save', SubmitType::class, ['label' => _m('Submit')]], ]); @@ -78,9 +72,7 @@ class ProfileColor $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); - //var_dump($data['color']); - // Must get old id before inserting another one if ($pcolor != null) { DB::remove($pcolor); DB::flush(); diff --git a/plugins/ProfileColor/ProfileColor.php b/plugins/ProfileColor/ProfileColor.php index 3aa2c36f74..e7de756a08 100644 --- a/plugins/ProfileColor/ProfileColor.php +++ b/plugins/ProfileColor/ProfileColor.php @@ -67,8 +67,6 @@ class ProfileColor extends Module $color = DB::find('profile_color', ['gsactor_id' => Common::user()->getId()]); if ($color != null) { $vars['profile_extras'][] = ['name' => 'profilecolor', 'vars' => ['color' => $color->getColor()]]; - } else { - $vars['profile_extras'][] = ['name' => 'profilecolor', 'vars' => []]; } } return Event::next; @@ -83,8 +81,7 @@ class ProfileColor extends Module */ public function onStartShowStyles(array &$styles): bool { - - //$styles[] = 'profilecolor/profilecolor.css'; + $styles[] = 'profilecolor/profilecolor.css'; return Event::next; } } diff --git a/public/assets/css/profilecolor/profilecolor.css b/public/assets/css/profilecolor/profilecolor.css new file mode 100644 index 0000000000..b4c67e00c0 --- /dev/null +++ b/public/assets/css/profilecolor/profilecolor.css @@ -0,0 +1,16 @@ +.pcolor{ + width: 100%; + height: 100%; + position: absolute; + top:0; + left: 0; + z-index: -1; +} + +.profile-color{ + width: 100%; + height: 100%; + background-color: transparent; + box-sizing: border-box; + border: 5px solid; +} diff --git a/templates/profilecolor/view.html.twig b/templates/profilecolor/view.html.twig index 334234db7d..20d0bd5fbd 100644 --- a/templates/profilecolor/view.html.twig +++ b/templates/profilecolor/view.html.twig @@ -1,8 +1,6 @@ {% if vars is not empty %} -
{{ vars.color }}
- {% else %} -
+
{% endif %}
\ No newline at end of file