Show message on public part : renderMessage > Documentation

This plugin allow a plugin dev to quickly show a message anywhere on surveys. Showing a complete message and end the page or just display a flash message.

This plugin offer 2 functions for other plugin, after activation : render and flashMessage. Plugin are tested on LimeSurvey 2.62.0, and must work partially on lesser version. On lesser version, only renderMessage is available.

render a message in your plugin

To show a message to a public user and quit after, simply use this part of code:

  1. $message="Message to be shown to your user";
  2. $renderMessage = new \renderMessage\messageHelper();
  3. $renderMessage->render($message);

Download

There are only one parameters : string to be shown, no filter is set: the you can use HTML in your message.

The plugin find the language and the template to use directly testing the survey, the language of user and the default template used.

render a flash message in your plugin

To show a flash message to a public user like an alert, simply use this part of code:

  1. $message="Message to be shown to your user";
  2. $renderMessage = \renderMessage\flashMessageHelper::getInstance();
  3. $renderFlashMessage->addFlashMessage($message,'warning');

Download

The plugin use 2 parameters : the HTML message and the extra class for the box : available are success, info, warning and danger.

Each flash message have class rm-flash-message and the alert alert-type for default bootsrap class inside a wrapper with class rm-flash-container

The css are

  1. .rm-flash-container{
  2.    position:fixed;
  3.    top:2em;
  4.    right:2em;
  5.    width:20em;
  6.    z-index:100000;/* default template 2000 : wher we go after ? */
  7. }

Download

Download the plugin

Plugin can be downloaded at gitlab.