From bd16dc7c6fc630a6b59ca3b041dde146ab50c72b Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Wed, 22 Apr 2020 22:13:28 +0200 Subject: colors refactor with exceptions --- app/class/Controllerhome.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/class/Controllerhome.php') diff --git a/app/class/Controllerhome.php b/app/class/Controllerhome.php index d1c7a11..6e2155a 100644 --- a/app/class/Controllerhome.php +++ b/app/class/Controllerhome.php @@ -28,7 +28,9 @@ class Controllerhome extends Controllerpage $pagelist = $this->modelhome->pagelist(); $this->opt = $this->modelhome->optinit($pagelist); - $vars['colors'] = new Colors($this->opt->taglist()); + + $vars['colors'] = new Colors(Model::COLORS_FILE, $this->opt->taglist()); + $deepsearch = $this->deepsearch(); @@ -130,10 +132,8 @@ class Controllerhome extends Controllerpage public function colors() { if (isset($_POST['tagcolor']) && $this->user->issupereditor()) { - $colors = new Colors(); - $colors->hydrate($_POST); - $colors->tocss(); - $colors->writecssfile(); + $colors = new Colors(Model::COLORS_FILE); + $colors->update($_POST['tagcolor']); } $this->routedirect('home'); } -- cgit v1.2.3