2if (!defined(
'NOREQUIRESOC')) {
3 define(
'NOREQUIRESOC',
'1');
5if (!defined(
'NOCSRFCHECK')) {
6 define(
'NOCSRFCHECK', 1);
8if (!defined(
'NOTOKENRENEWAL')) {
9 define(
'NOTOKENRENEWAL', 1);
11if (!defined(
'NOLOGIN')) {
14if (!defined(
'NOREQUIREHTML')) {
15 define(
'NOREQUIREHTML', 1);
17if (!defined(
'NOREQUIREAJAX')) {
18 define(
'NOREQUIREAJAX',
'1');
20if (!defined(
'NOSESSION')) {
21 define(
'NOSESSION',
'1');
23if (!defined(
'NOREQUIREMENU')) {
24 define(
'NOREQUIREMENU',
'1');
26session_cache_limiter(
'public');
28require_once
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
32if ($dolibarr_main_prod) {
41llxHeader(
'',
'Documentation and examples for theme');
44 <h1
class=
"bd-title" id=
"content">Button
for action</h1>
45 <p
class=
"bd-lead">Documentation and examples
for buttons.</p>
47 <h2
id=
"example01">Example of simple
usage</h2>
49 <p>Buttons
for user allowed to click.</p>
51 <div
class=
"bd-example">
54 $label =
'My action label used for accessibility visually for impaired people';
55 $html =
'<span class="fa fa-clone" ></span> My default action';
56 $actionType =
'default';
58 $id =
'mybuttonid'.$n;
66 $html =
'<span class="fa fa-clone" ></span> My delete action';
67 $actionType =
'delete';
69 $id =
'mybuttonid'.$n;
70 $url = $_SERVER[
'PHP_SELF'] .
'?token='.newToken().
'#'.$id;
74 $html =
'<span class="fa fa-clone" ></span> My danger action';
75 $actionType =
'danger';
77 $id =
'mybuttonid'.$n;
78 $url = $_SERVER[
'PHP_SELF'] .
'?token='.newToken().
'#'.$id;
84 <p>Buttons
for user <strong>NOT</strong> allowed to click.</p>
86 <div
class=
"bd-example">
88 $label =
'My action label used for accessibility visually for impaired people';
89 $html =
'<span class="fa fa-clone" ></span> My default action';
90 $actionType =
'default';
92 $id =
'mybuttonid'.$n;
99 $html =
'<span class="fa fa-clone" ></span> My delete action';
100 $actionType =
'delete';
102 $id =
'mybuttonid'.$n;
103 $url = $_SERVER[
'PHP_SELF'] .
'?token='.newToken().
'#'.$id;
107 $html =
'<span class="fa fa-clone" ></span> My danger action';
108 $actionType =
'danger';
110 $id =
'mybuttonid'.$n;
111 $url = $_SERVER[
'PHP_SELF'] .
'?token='.newToken().
'#'.$id;
118 <h2
id=
"example01">Example of confirm dialog</h2>
120 <p>Buttons
for user allowed to click.</p>
122 <div
class=
"bd-example">
124 $label =
'My action label used for accessibility visually for impaired people';
125 $html =
'<span class="fa fa-clone" ></span> My default action';
126 $actionType =
'default';
128 $id =
'mybuttonid'.$n;
138 $html =
'<span class="fa fa-clone" ></span> My delete action';
139 $actionType =
'delete';
141 $id =
'mybuttonid'.$n;
142 $url = $_SERVER[
'PHP_SELF'] .
'?token='.newToken().
'#'.$id;
146 'url' =>
'your confirm action url',
147 'title' =>
'Your title to display',
148 'action-btn-label' =>
'Your confirm label',
149 'cancel-btn-label' =>
'Your cancel label',
150 'content' =>
'Content to display with <strong>HTML</strong> compatible <ul><li>test 01</li><li>test 02</li><li>test 03</li></ul>'
159 <p>Buttons
for user <strong>NOT</strong> allowed to click.</p>
161 <div
class=
"bd-example">
163 $label =
'My action label used for accessibility visually for impaired people';
164 $html =
'<span class="fa fa-clone" ></span> My default action';
165 $actionType =
'default';
167 $id =
'mybuttonid'.$n;
177 $html =
'<span class="fa fa-clone" ></span> My delete action';
178 $actionType =
'delete';
180 $id =
'mybuttonid'.$n;
181 $url = $_SERVER[
'PHP_SELF'] .
'?token='.newToken().
'#'.$id;
185 'url' =>
'your confirm action url',
186 'title' =>
'Your title to display',
187 'action-btn-label' =>
'Your confirm label',
188 'cancel-btn-label' =>
'Your cancel label',
189 'content' =>
'Content to display with <strong>HTML</strong> compatible <ul><li>test 01</li><li>test 02</li><li>test 03</li></ul>'
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
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.