Module Description
The Toastr module provides an API that implements the Toastr.js library. Toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended.

The module works by polling the server for new messages, and displaying them as needed.

To have messages displayed, just implement hook_toastr_toast(). You get 2 parameters:


* the current user
* the timestamp from the js polling function

/** * Implements hook_toastr_toast(). */ function hook_toastr_toast($account, $timestamp) { $toast = array( 'type' => 'info' 'message' => t('A message to be displayed.'), ); $toasts[] = $toast; $toast = array( 'type' => 'success' 'message' => t("@name is on a toast!", array('@name' => format_username($account))); ); $toasts[] = $toast; return $toasts; } You can also alter toastr messages before they are sent to the browser:

/** * Implements hook_toastr_toasts_alter(). **/ function example_toastr_toasts_alter(&$toasts, $account, $timestamp) { // Do something with the yummy toast. foreach ($toasts as $key => $toast) { // Prevent toasts from showing to anonymous users. if ($account->uid == 0) { unset($toasts[$key]); } } } Implementation
This module will do nothing on its own. You will need to implement the above hooks in a custom module in order for anything to happen, or enable one of the included sub-modules.

Included Sub-Modules Toastr Message
Included in the main project is a sub-module for the Message Stack. The sub-module can act as an example module as well as be used on its own to turn Message entities into Toastr notifications.

Toastr Database Log
This sub-module will display database log messages via Toastr. You can select what message severity levels are displayed.

Requirements
Libraries Toastr Library

Project Usage
142
Creation Date
Changed Date
Security Covered
Not Covered By Security Advisory
Version Available
Production
Module Summary
The Toastr module aims to solve the need for Gnome/Growl type non-blocking notifications in a customizable and extendable way by implementing the Toastr.js library through an API.
Data Name
toastr

OPENAI CHATBOT

OPENAI CHATBOT

14:29:10
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.