File ManagerCurrent Directory: wp-content/plugins/backwpup/src/Infrastructure/RestoreLinux appserver-0d5e4f1e-php-cc8da225320a42ba9b7d66cba40b1f03 6.6.123+ #1 SMP PREEMPT_DYNAMIC Wed Mar 11 09:04:28 UTC 2026 x86_64Edit File: Notificator.php <?php /** * Restore Notifications. */ declare(strict_types=1); namespace Inpsyde\BackWPup\Infrastructure\Restore; use function add_action; use Inpsyde\Restore\Api\Module\Session\NotificableStorableSessionInterface; use Inpsyde\Restore\Api\Module\Session\Session; /** * Class Notifications. * * @since */ final class Notificator { /** * Session. * * @var NotificableStorableSessionInterface The session to use to retrieve the messages */ private $session; /** * List of notifications. * * @var array<string, string[]> The container for the notifications message */ private $notifications = []; /** * Notificator constructor. * * @param NotificableStorableSessionInterface $session the session to use * to retrieve the messages * @param TranslatorInterface $translator the translator for strings */ public function __construct(NotificableStorableSessionInterface $session) { $this->session = $session; } /** * Load. * * Set the hooks */ public function load(): void { add_action( (is_network_admin() ? 'network_admin_notices' : 'admin_notices'), [$this, 'notify'] ); } /** * Notify. * * Load the template and show the notifications */ public function notify(): void { $this->setNotifications(); $this->notifications && backwpup_template( // phpcs:ignore (object) [ 'notifies' => $this->notifications, ], '/restore/notifications.php' ); } /** * Set Notifications. */ private function setNotifications(): void { foreach ($this->session->notifications() as $note) { // Create a new item if not exists. if (!isset($this->notifications[$note['level']])) { $this->notifications[$note['level']] = []; } // Set the message and translate it. // Don't use WordPress functions here because the text messages come from the shared library. $this->notifications[$note['level']][] = __($note['msg'], 'backwpup'); } // Clean the session. $this->session->delete('notifications'); } } Upload File Directory Listing NameTypeSizeActions.. (Parent Directory)DirLogDownloaderDirectory Rename | DeleteNotificator.phpFile2.34 KB Rename | Delete | EditRestore.phpFile5.33 KB Rename | Delete | EditTemplateLoader.phpFile8.52 KB Rename | Delete | Editcommons.phpFile12.34 KB Rename | Delete | Edit