* Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ // Load Dolibarr environment require '../../../../main.inc.php'; /** * @var DoliDB $db * @var HookManager $hookmanager * @var Translate $langs * @var User $user */ // Protection if external user if ($user->socid > 0) { accessforbidden(); } // Includes require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); $action = GETPOST('action', 'alpha'); if ($action == 'displayeventmessage') { setEventMessages($langs->trans('DocSetEventMessageUnique'), null); } elseif ($action == 'displayeventmessages') { $messageArray = [$langs->trans('DocSetEventMessage', '1'), $langs->trans('DocSetEventMessage', '2'), $langs->trans('DocSetEventMessage', '3')]; setEventMessages(null, $messageArray); } elseif ($action == 'displayeventmessageok') { setEventMessages($langs->trans('DocSetEventMessageOK'), null); } elseif ($action == 'displayeventmessagewarning') { setEventMessages($langs->trans('DocSetEventMessageWarning'), null, 'warnings'); } elseif ($action == 'displayeventmessageerror') { setEventMessages($langs->trans('DocSetEventMessageError'), null, 'errors'); } // $documentation = new Documentation($db); $morejs = [ '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', '/includes/ace/src/ext-language_tools.js', ]; // Output html head + body - Param is Title $documentation->docHeader('SetEventMessages', $morejs); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class $documentation->view = array('Components','Event Message'); // Output sidebar $documentation->showSidebar(); ?>
showBreadCrumb(); ?>

trans('DocSetEventMessageTitle'); ?>

trans('DocSetEventMessageMainDescription'); ?>

showSummary(); ?>

trans('DocBasicUsage'); ?>

trans('DocSetEventMessageDescription'); ?>

'.$langs->trans('DocSetEventMessageDisplayMessage'); $action_type = 'displayeventmessage'; $url = $_SERVER["PHP_SELF"].'?action=displayeventmessage'; print dolGetButtonAction($label, $html, $action_type, $url, '', $user_right); $label = 'My action label used for accessibility visually for impaired people'; $user_right = 1; $html = ''.$langs->trans('DocSetEventMessageDisplayMessages'); $action_type = 'displayeventmessages'; $url = $_SERVER["PHP_SELF"].'?action=displayeventmessages'; print dolGetButtonAction($label, $html, $action_type, $url, '', $user_right); ?>
showCode($lines, 'php'); ?>

trans('DocSetEventMessageContextualVariations'); ?>

trans('DocSetEventMessageContextualVariationsDescription'); ?>

'.$langs->trans('DocSetEventMessageDisplayOKMessage'); $action_type = 'displayeventmessageok'; $url = $_SERVER["PHP_SELF"].'?action=displayeventmessageok#seteventmessagesection-contextvariations'; $params['attr']['style'] = 'background: #446548'; print dolGetButtonAction('', $html, $action_type, $url, '', $user_right, $params); $label = 'My action label used for accessibility visually for impaired people'; $user_right = 1; $html = ''.$langs->trans('DocSetEventMessageDisplayWarningMessage'); $action_type = 'displayeventmessagewarning'; $url = $_SERVER["PHP_SELF"].'?action=displayeventmessagewarning#seteventmessagesection-contextvariations'; $params['attr']['style'] = 'background: #a28918'; print dolGetButtonAction($label, $html, $action_type, $url, '', $user_right, $params); $label = 'My action label used for accessibility visually for impaired people'; $user_right = 1; $html = ''.$langs->trans('DocSetEventMessageDisplayErrorMessage'); $action_type = 'displayeventmessageerror'; $url = $_SERVER["PHP_SELF"].'?action=displayeventmessageerror#seteventmessagesection-contextvariations'; $params['attr']['style'] = 'background: #a72947'; print dolGetButtonAction($label, $html, $action_type, $url, '', $user_right, $params); ?>
showCode($lines, 'php'); ?>
docFooter(); ?>