21require
'../../../../main.inc.php';
31if ($user->socid > 0) {
36require_once DOL_DOCUMENT_ROOT .
'/admin/tools/ui/class/documentation.class.php';
39$langs->load(
'uxdocumentation');
41$action =
GETPOST(
'action',
'alpha');
43if ($action ==
'displayeventmessage') {
45} elseif ($action ==
'displayeventmessages') {
46 $messageArray = [$langs->trans(
'DocSetEventMessage',
'1'),
47 $langs->trans(
'DocSetEventMessage',
'2'),
48 $langs->trans(
'DocSetEventMessage',
'3')];
50} elseif ($action ==
'displayeventmessageok') {
52} elseif ($action ==
'displayeventmessagewarning') {
53 setEventMessages($langs->trans(
'DocSetEventMessageWarning'),
null,
'warnings');
54} elseif ($action ==
'displayeventmessageerror') {
61 '/includes/ace/src/ace.js',
62 '/includes/ace/src/ext-statusbar.js',
63 '/includes/ace/src/ext-language_tools.js',
66$documentation->docHeader(
'SetEventMessages', $morejs);
70$documentation->view = array(
'Components',
'Event Message');
73$documentation->showSidebar(); ?>
75<div
class=
"doc-wrapper">
77 <?php $documentation->showBreadCrumb(); ?>
79 <div
class=
"doc-content-wrapper">
81 <h1
class=
"documentation-title"><?php echo $langs->trans(
'DocSetEventMessageTitle'); ?></h1>
82 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocSetEventMessageMainDescription'); ?></p>
85 <?php $documentation->showSummary(); ?>
88 <div
class=
"documentation-section" id=
"seteventmessagesection-basicusage">
89 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBasicUsage'); ?></h2>
90 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocSetEventMessageDescription'); ?></p>
91 <div
class=
"documentation-example">
93 $label =
'My action label used for accessibility visually for impaired people';
96 $html =
'<span class="fa fa-comment paddingright"></span>'.$langs->trans(
'DocSetEventMessageDisplayMessage');
97 $action_type =
'displayeventmessage';
98 $url = $_SERVER[
"PHP_SELF"].
'?action=displayeventmessage';
101 $label =
'My action label used for accessibility visually for impaired people';
104 $html =
'<span class="fa fa-comments paddingright"></span>'.$langs->trans(
'DocSetEventMessageDisplayMessages');;
105 $action_type =
'displayeventmessages';
106 $url = $_SERVER[
"PHP_SELF"].
'?action=displayeventmessages';
127 'setEventMessages("message", null);',
128 'setEventMessages(null, messages[]);',
130 echo $documentation->showCode($lines,
'php'); ?>
133 <!-- Contextual variations -->
134 <div
class=
"documentation-section" id=
"seteventmessagesection-contextvariations">
135 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocSetEventMessageContextualVariations'); ?></h2>
136 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocSetEventMessageContextualVariationsDescription'); ?></p>
137 <div
class=
"documentation-example">
139 $label =
'My action label used for accessibility visually for impaired people';
141 $html =
'<span class="fa fa-comment paddingright"></span>'.$langs->trans(
'DocSetEventMessageDisplayOKMessage');;
142 $action_type =
'displayeventmessageok';
143 $url = $_SERVER[
"PHP_SELF"].
'?action=displayeventmessageok#seteventmessagesection-contextvariations';
144 $params[
'attr'][
'style'] =
'background: #446548';
147 $label =
'My action label used for accessibility visually for impaired people';
149 $html =
'<span class="fa fa-comment paddingright"></span>'.$langs->trans(
'DocSetEventMessageDisplayWarningMessage');;
150 $action_type =
'displayeventmessagewarning';
151 $url = $_SERVER[
"PHP_SELF"].
'?action=displayeventmessagewarning#seteventmessagesection-contextvariations';
152 $params[
'attr'][
'style'] =
'background: #a28918';
153 print
dolGetButtonAction($label, $html, $action_type, $url,
'', $user_right, $params);
155 $label =
'My action label used for accessibility visually for impaired people';
157 $html =
'<span class="fa fa-comment paddingright"></span>'.$langs->trans(
'DocSetEventMessageDisplayErrorMessage');;
158 $action_type =
'displayeventmessageerror';
159 $url = $_SERVER[
"PHP_SELF"].
'?action=displayeventmessageerror#seteventmessagesection-contextvariations';
160 $params[
'attr'][
'style'] =
'background: #a72947';
161 print
dolGetButtonAction($label, $html, $action_type, $url,
'', $user_right, $params); ?>
166 'setEventMessages("message", null)',
167 'setEventMessages("message", null, "warnings")',
168 'setEventMessages("message", null, "errors")'
170 echo $documentation->showCode($lines,
'php'); ?>
179$documentation->docFooter();
Class to manage UI documentation.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
usage($program, $header)
Print the usage when executing scripts from install/.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.