21if (! $res && file_exists(
"../../main.inc.php")) : $res=@include
'../../main.inc.php';
23if (! $res && file_exists(
"../../../main.inc.php")) : $res=@include
'../../../main.inc.php';
25if (! $res && file_exists(
"../../../../main.inc.php")) : $res=@include
'../../../../main.inc.php';
36$langs->load(
'uxdocumentation');
42$documentation->docHeader(
'Badges');
46$documentation->view = array(
'Components',
'Badges');
49$documentation->showSidebar(); ?>
51<div
class=
"doc-wrapper">
53 <?php $documentation->showBreadCrumb(); ?>
55 <div
class=
"doc-content-wrapper">
57 <h1
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgeTitle'); ?></h1>
58 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeMainDescription'); ?></p>
61 <?php $documentation->showSummary(); ?>
64 <div
class=
"documentation-section" id=
"badgesection-basicusage">
65 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBasicUsage'); ?></h2>
66 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeScaleDescription'); ?></p>
67 <div
class=
"documentation-example">
68 <h1>Example heading <span
class=
"badge badge-secondary">New</span></h1>
69 <h2>Example heading <span
class=
"badge badge-secondary">New</span></h2>
70 <h3>Example heading <span
class=
"badge badge-secondary">New</span></h3>
71 <h4>Example heading <span
class=
"badge badge-secondary">New</span></h4>
72 <h5>Example heading <span
class=
"badge badge-secondary">New</span></h5>
73 <h6>Example heading <span
class=
"badge badge-secondary">New</span></h6>
78 '<h1>Example heading <span class="badge badge-secondary">New</span></h1>',
79 '<h2>Example heading <span class="badge badge-secondary">New</span></h2>',
80 '<h3>Example heading <span class="badge badge-secondary">New</span></h3>',
81 '<h4>Example heading <span class="badge badge-secondary">New</span></h4>',
82 '<h5>Example heading <span class="badge badge-secondary">New</span></h5>',
83 '<h6>Example heading <span class="badge badge-secondary">New</span></h6>'
85 echo $documentation->showCode($lines); ?>
87 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeUseOnLinksOrButtons'); ?></p>
88 <div
class=
"documentation-example">
90 <?php echo $langs->trans(
'Notifications'); ?> <span
class=
"badge badge-primary">4</span>
96 '<button type="button" class="button">',
97 ' Notifications <span class="badge badge-primary">4</span>',
100 echo $documentation->showCode($lines); ?>
102 <div
class=
"warning">
103 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeWarningAriaHidden1'); ?></p>
104 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeWarningAriaHidden2'); ?></p>
105 <p
class=
"documentation-text"><strong><?php echo $langs->trans(
'DocBadgeWarningAriaHidden3'); ?></strong></p>
108 <div
class=
"documentation-example">
110 Profile <span
class=
"badge badge-primary" aria-label=
"9 unread messages" >9</span>
111 <span
class=
"sr-only">unread messages</span>
117 '<button type="button" class="button">',
118 ' Profile <span class="badge badge-primary" aria-label="9 unread messages" >9</span>',
119 ' <span class="sr-only">unread messages</span>',
122 echo $documentation->showCode($lines); ?>
125 <!-- Contextual variations -->
126 <div
class=
"documentation-section" id=
"badgesection-contextvariations">
127 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgeContextualVariations'); ?></h2>
128 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeContextualVariationsDescription'); ?></p>
129 <div
class=
"documentation-example">
130 <span
class=
"badge badge-primary">Primary</span>
131 <span
class=
"badge badge-secondary">Secondary</span>
132 <span
class=
"badge badge-success">Success</span>
133 <span
class=
"badge badge-danger">Danger</span>
134 <span
class=
"badge badge-warning">Warning</span>
135 <span
class=
"badge badge-info">Info</span>
136 <span
class=
"badge badge-light">Light</span>
137 <span
class=
"badge badge-dark">Dark</span>
141 '<span class="badge badge-primary">Primary</span>',
142 '<span class="badge badge-secondary">Secondary</span>',
143 '<span class="badge badge-success">Success</span>',
144 '<span class="badge badge-danger">Danger</span>',
145 '<span class="badge badge-warning">Warning</span>',
146 '<span class="badge badge-info">Info</span>',
147 '<span class="badge badge-light">Light</span>',
148 '<span class="badge badge-dark">Dark</span>',
150 echo $documentation->showCode($lines); ?>
151 <div
class=
"warning">
152 <p
class=
"documentation-text"><strong><?php echo $langs->trans(
'DocBadgeContextualVariationsWarning1'); ?></strong></p>
153 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeContextualVariationsWarning2'); ?></p>
158 <div
class=
"documentation-section" id=
"badgesection-defaultstatus">
159 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgeDefaultStatus'); ?></h2>
160 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeDefaultStatusDescription'); ?></p>
161 <div
class=
"documentation-example">
162 <?php
for ($i = 0; $i <= 9; $i++) : ?>
163 <span
class=
"badge badge-status<?php print $i; ?>" >
status-<?php print $i; ?></span>
168 for ($i = 0; $i <= 9; $i++) :
169 $lines[] =
'<span class="badge badge-status'.$i.
'">status-'.$i.
'</span>';
171 echo $documentation->showCode($lines); ?>
175 <div
class=
"documentation-section" id=
"badgesection-pill">
176 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgePillBadges'); ?></h2>
177 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgePillBadgesDescription'); ?></p>
178 <div
class=
"documentation-example">
179 <span
class=
"badge badge-pill badge-primary">Primary</span>
180 <span
class=
"badge badge-pill badge-secondary">Secondary</span>
181 <span
class=
"badge badge-pill badge-success">Success</span>
182 <span
class=
"badge badge-pill badge-danger">Danger</span>
183 <span
class=
"badge badge-pill badge-warning">Warning</span>
184 <span
class=
"badge badge-pill badge-info">Info</span>
185 <span
class=
"badge badge-pill badge-light">Light</span>
186 <span
class=
"badge badge-pill badge-dark">Dark</span>
187 <?php
for ($i = 0; $i <= 9; $i++) : ?>
193 '<span class="badge badge-pill badge-primary">Primary</span>',
194 '<span class="badge badge-pill badge-secondary">Secondary</span>',
195 '<span class="badge badge-pill badge-success">Success</span>',
196 '<span class="badge badge-pill badge-danger">Danger</span>',
197 '<span class="badge badge-pill badge-warning">Warning</span>',
198 '<span class="badge badge-pill badge-info">Info</span>',
199 '<span class="badge badge-pill badge-light">Light</span>',
200 '<span class="badge badge-pill badge-dark">Dark</span>',
202 for ($i = 0; $i <= 9; $i++) :
203 $lines[] =
'<span class="badge badge-pill badge-status'.$i.
'">status-'.$i.
'</span>';
205 echo $documentation->showCode($lines); ?>
209 <div
class=
"documentation-section" id=
"badgesection-dot">
210 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgeDotBadges'); ?></h2>
211 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeDotBadgesDescription'); ?></p>
212 <div
class=
"documentation-example">
213 <span
class=
"badge badge-dot badge-primary"></span>
214 <span
class=
"badge badge-dot badge-secondary"></span>
215 <span
class=
"badge badge-dot badge-success"></span>
216 <span
class=
"badge badge-dot badge-danger"></span>
217 <span
class=
"badge badge-dot badge-warning"></span>
218 <span
class=
"badge badge-dot badge-info"></span>
219 <span
class=
"badge badge-dot badge-light"></span>
220 <span
class=
"badge badge-dot badge-dark"></span>
221 <?php
for ($i = 0; $i <= 9; $i++) : ?>
222 <span
class=
"badge badge-dot badge-status<?php print $i; ?>"></span>
227 '<span class="badge badge-dot badge-primary"></span>',
228 '<span class="badge badge-dot badge-secondary"></span>',
229 '<span class="badge badge-dot badge-success"></span>',
230 '<span class="badge badge-dot badge-danger"></span>',
231 '<span class="badge badge-dot badge-warning"></span>',
232 '<span class="badge badge-dot badge-info"></span>',
233 '<span class="badge badge-dot badge-light"></span>',
234 '<span class="badge badge-dot badge-dark"></span>',
236 for ($i = 0; $i <= 9; $i++) :
237 $lines[] =
'<span class="badge badge-dot badge-status'.$i.
'"></span>';
239 echo $documentation->showCode($lines); ?>
243 <div
class=
"documentation-section" id=
"badgesection-links">
244 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgeLinks'); ?></h2>
245 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeLinksDescription'); ?></p>
246 <div
class=
"documentation-example">
247 <a href=
"#" class=
"badge badge-primary">Primary</a>
248 <a href=
"#" class=
"badge badge-secondary">Secondary</a>
249 <a href=
"#" class=
"badge badge-success">Success</a>
250 <a href=
"#" class=
"badge badge-danger">Danger</a>
251 <a href=
"#" class=
"badge badge-warning">Warning</a>
252 <a href=
"#" class=
"badge badge-info">Info</a>
253 <a href=
"#" class=
"badge badge-light">Light</a>
254 <a href=
"#" class=
"badge badge-dark">Dark</a>
255 <?php
for ($i = 0; $i <= 9; $i++) : ?>
261 '<a href="#" class="badge badge-primary">Primary</a>',
262 '<a href="#" class="badge badge-secondary">Secondary</a>',
263 '<a href="#" class="badge badge-success">Success</a>',
264 '<a href="#" class="badge badge-danger">Danger</a>',
265 '<a href="#" class="badge badge-warning">Warning</a>',
266 '<a href="#" class="badge badge-info">Info</a>',
267 '<a href="#" class="badge badge-light">Light</a>',
268 '<a href="#" class="badge badge-dark">Dark</a>',
270 for ($i = 0; $i <= 9; $i++) :
271 $lines[] =
'<a href="#" class="badge badge-status'.$i.
'" >status'.$i.
'</a>';
273 echo $documentation->showCode($lines); ?>
276 <!-- Use badge helper
function -->
277 <div
class=
"documentation-section" id=
"badgesection-dolgetbadge">
278 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBadgeHelper'); ?></h2>
279 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocBadgeHelperDescription'); ?></p>
280 <div
class=
"documentation-example">
281 <?php print
dolGetBadge(
'your label for accessibility',
'your label <u>with</u> <em>html</em>',
'primary'); ?>
282 <?php print
dolGetBadge(
'your label for accessibility',
'your label <u>with</u> <em>html</em>',
'danger',
'pill'); ?>
283 <?php print
dolGetBadge(
'your label for accessibility',
'your label',
'warning',
'dot'); ?>
288 " * Function dolGetBadge",
290 " * @param string \$label label of badge no html : use in alt attribute for accessibility",
291 " * @param string \$html optional : label of badge with html",
292 " * @param string \$type type of badge : Primary Secondary Success Danger Warning Info Light Dark status0 status1 status2 status3 status4 status5 status6 status7 status8 status9",
293 " * @param string \$mode Default '' , 'pill', 'dot'",
294 " * @param string \$url the url for link",
295 " * ... See more: core/lib/functions.lib.php ",
297 "<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'primary'); ?>",
298 "<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'danger', 'pill'); ?>",
299 "<?php print dolGetBadge('your label for accessibility', 'your label', 'warning', 'dot'); ?>",
301 echo $documentation->showCode($lines); ?>
312$documentation->docFooter();
Class to manage UI documentation.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
dolGetBadge($label, $html='', $type='primary', $mode='', $url='', $params=array())
Function dolGetBadge.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
usage($program, $header)
Print the usage when executing scripts from install/.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.