SondagesPro / LS-renderMessage

Mirror of https://gitlab.com/SondagesPro/coreAndTools/renderMessage

Home Page:http://extensions.sondages.pro/development-and-example/show-message-on-public-part-rendermessage/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

renderMessage

A plugin for other plugin, allowing to render a public page or send a warning to public user.

Usage

This plugin offer 2 functions for other plugin, after activation : render and flashMessage. Plugin are tested on LimeSurvey 3.8, and must work partially on version up to 3.0.

This plugin is compatible with LimeSurvey 2.73 version, but some function need update.

render

  • string $message : message send to twig file
  • string|null $layout to be used (must be in a views directory, final name start by layout_ (added here)). By default to global
  • string|null $content to be used (layout dependent : in /subviews/content/ for layout 'global', default to included view content.twig)
  • array $aData to be merged from default data

To show any content to a public user with default layout of current survey and defaut title (survey name or sitename).

    \renderMessage\messageHelper::renderContent($content);

To show any content to a public user with layout, title and data.

    $renderMessage = new \renderMessage\messageHelper();
    $renderMessage->render($content,$layout,$content,$aData);

Warning : there are difference in render function with LimeSurvey 2.XX version.

renderAlert

  • string $message : the html message t be shown to user, language and template are automatically set by actual situation.
  • string $type : message type, using alert class of BootStrap then success,info,warning,danger. Default is info.

To show an alert message to a public user and quit after.

    \renderMessage\messageHelper::renderAlert($message,$type);

flashMessage

  • string $message : message to be shown to user like a flash
  • string $type : message type, using alert class of BootStrap then success,info,warning,danger. Default is info.

To add one flash message to a public user.

    \renderMessage\flashMessageHelper::getInstance()->addFlashMessage($message,$type);

Not working for 2.6lts and lesser version_ Not working for 3.0 and upper version_

Replace twig file in your survey template.

This plugin add and use subviews/content/alert.twig, subviews/content/content.twig, subviews/messages/flash_messages.twig and subviews/messages/flash_message.twig.

Installation

See Install and activate a plugin for LimeSurvey .

After update of this plugin, best is to reset assets globally. You can do it via Global settings with Clear assets cache button.

Via GIT

  • Go to your LimeSurvey Directory
  • Clone in plugins/renderMessage directory

Via ZIP dowload

Home page & Copyright

Distributed under AFFERO GNU GENERAL PUBLIC LICENSE Version 3 licence. If you need a more permissive Licence contact.

About

Mirror of https://gitlab.com/SondagesPro/coreAndTools/renderMessage

http://extensions.sondages.pro/development-and-example/show-message-on-public-part-rendermessage/

License:GNU Affero General Public License v3.0


Languages

Language:PHP 94.4%Language:Twig 2.4%Language:JavaScript 1.9%Language:CSS 1.3%