app['border-manager']; /** @var TranslatorInterface $translator */ $translator = $this->app['translator']; $reasons = array_map(function ($checkerFQCN) use ($manager, $translator) { try { return $manager->getCheckerFromFQCN($checkerFQCN)->getMessage($translator); } catch (RuntimeException $e) { // show the name of the checker disabled $t =explode('\\', $checkerFQCN); return $this->app->trans('notifications:: checker %checker% for this file is disabled in configuration or deleted', ['%checker%' => $t[4]]); } }, $data['reasons']); $filename = $data['filename']; $text = $this->app->trans('The document %name% has been quarantined', ['%name%' => htmlentities($filename)]); if ($reasons) { $text .= ' ' . $this->app->trans('for the following reasons : %reasons%', ['%reasons%' => implode(', ', $reasons)]); } $ret = ['text' => $text, 'class' => '']; return $ret; } /** * @return string */ public function get_name() { return $this->app->trans('Quarantine notificaton'); } /** * @return string */ public function get_description() { return $this->app->trans('be notified when a document is placed in quarantine'); } /** * @param integer $usr_id The id of the user to check * * @return boolean */ public function is_available(User $user) { return $this->app->getAclForUser($user)->has_right(\ACL::CANADDRECORD); } }