Fixed notifications that would not be remembered as hidden + various improvements

This commit is contained in:
Djamil Legato
2020-12-21 15:29:42 -08:00
parent 06719a23dd
commit 72116dcbca
9 changed files with 46 additions and 17 deletions

View File

@@ -551,11 +551,12 @@ class AdminController extends AdminBaseController
return false;
}
$filename = $this->grav['locator']->findResource('user://data/notifications/' . $this->grav['user']->username . YAML_EXT,
true, true);
$filename = $this->grav['locator']->findResource('user://data/notifications/' . $this->grav['user']->username . YAML_EXT, true, true);
$file = CompiledYamlFile::instance($filename);
$data = (array)$file->content();
$data[] = $notification_id;
$date = new \DateTime();
$data[$notification_id] = $date->format('r');
$file->save($data);
$this->admin->json_response = [