21require
'../../../../main.inc.php';
31if ($user->socid > 0) {
36require_once DOL_DOCUMENT_ROOT .
'/admin/tools/ui/class/documentation.class.php';
37require_once DOL_DOCUMENT_ROOT .
'/core/class/html.form.class.php';
40$langs->load(
'uxdocumentation');
43$hookmanager->initHooks(array(
'uidocumentation'));
50 '/includes/ace/src/ace.js',
51 '/includes/ace/src/ext-statusbar.js',
52 '/includes/ace/src/ext-language_tools.js',
55$documentation->docHeader(
'Titles', $morejs);
59$documentation->view = array(
'Content',
'Titles');
62$documentation->showSidebar(); ?>
64<div
class=
"doc-wrapper">
66 <?php $documentation->showBreadCrumb(); ?>
68 <div
class=
"doc-content-wrapper">
70 <h1
class=
"documentation-title"><?php echo $langs->trans(
'DocTitleTitle'); ?></h1>
71 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTitleMainDescription'); ?></p>
74 <?php $documentation->showSummary(); ?>
77 <div
class=
"documentation-section" id=
"titlesection-basicusage">
79 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocBasicUsage'); ?></h2>
81 <p
class=
"documentation-text"><?php echo $langs->transnoentities(
'DocTitleBasicDescription'); ?></p>
83 <li><?php echo $langs->trans(
'DocTitleIconUsageMethod1',
dol_buildpath(
'/admin/tools/ui/components/icons.php#img-picto-section-list', 1)); ?></li>
84 <li><?php echo $langs->trans(
'DocTitleIconUsageMethod2',
dol_buildpath(
'/admin/tools/ui/components/icons.php#icon-section-list', 1)); ?></li>
85 <li><?php echo $langs->trans(
'DocTitleIconUsageMethod3'); ?></li>
87 <div
class=
"documentation-example">
88 <?php print
load_fiche_titre($langs->trans(
'DocMyPageTitle'),
'',
'info'); ?>
94 '// Title with icon, see list of icons in components/icons section',
95 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", "", "info");',
97 '// Title with fontawesome icon, see list of icons in components/icons section',
98 '// use like this: ICONCLASS_FAMILYCLASS_COLOR',
99 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", "", "fa-rocket_fas_#b0bb39");',
101 '// Title with custom image icon, 4th parameter must be 1',
102 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", "", "IMAGE_URL", 1);',
104 echo $documentation->showCode($lines,
'php'); ?>
106 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTitleMoreContentDescription'); ?></p>
107 <div
class=
"documentation-example">
108 <?php print
load_fiche_titre($langs->trans(
'DocMyPageTitle'),
'<a href="#">'.img_picto(
'',
'add',
'', 0, 0, 0,
'',
'valignmiddle btnTitle-icon').
'</a>',
'fa-rocket_fas_#b0bb39'); ?>
114 '// Title with picto link',
115 '$moreHtmlRight = \'<a href="#">\'.img_picto("", "add").\'</a>\';',
116 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", $moreHtmlRight, "fa-rocket_fas_#b0bb39");',
118 '// Title with badge',
119 '$moreHtmlRight = \'<span class="badge badge-pill badge-secondary">Secondary</span>\';',
120 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", $moreHtmlRight, "fa-rocket_fas_#b0bb39");',
123 '// Title with form',
124 '$moreHtmlRight = \'<form>...</form>\';',
125 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", $moreHtmlRight, "fa-rocket_fas_#b0bb39");',
127 '// Set ID for table and css class',
128 '$tableID = \'tableid\';',
129 '$moreclass = \'class1 class2\';',
130 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", $moreHtmlRight, "fa-rocket_fas_#b0bb39", 0, $tableID, $moreclass);',
132 '// Add html between title and right content',
133 '$moreContent = \'MyHTMLContent\';',
134 'print load_fiche_titre("'.$langs->trans(
'DocMyPageTitle').
'", $moreHtmlRight, "fa-rocket_fas_#b0bb39", 0, $tableID, $moreclass, $moreContent);',
136 echo $documentation->showCode($lines,
'php'); ?>
139 <!-- Table with filters -->
140 <div
class=
"documentation-section" id=
"titlesection-withfilters">
142 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocTitleWithFilters'); ?></h2>
144 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTitleWithFiltersDescription',
dol_buildpath(
'admin/tools/ui/components/inputs.php', 1)); ?></p>
145 <div
class=
"documentation-example">
147 $title = $langs->trans(
'DocMyPageTitle');
153 $morehtmlcenter =
'';
155 $totalnboflines = 56;
157 $pictoisfullpath = 0;
158 $morehtmlright =
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fas fa-bars',
'#',
'', 1);
159 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fas fa-grip-horizontal',
'#',
'', 1);
160 $morehtmlright .=
'<span class="button-title-separator"></span>';
161 $morehtmlright .=
'<a href="#">'.img_picto(
'',
'add',
'', 0, 0, 0,
'',
'valignmiddle btnTitle-icon').
'</a>';
164 $selectlimitsuffix = 0;
166 $pagenavastextinput = 1;
167 $morehtmlrightbeforearrow =
'';
168 print_barre_liste($title, $page, $file, $options, $sortfield, $sortorder, $morehtmlcenter, $num, $totalnboflines, $picto, $pictoisfullpath, $morehtmlright, $morecss, $limit, $selectlimitsuffix, $hidenavigation, $pagenavastextinput, $morehtmlrightbeforearrow); ?>
197 'print_barre_liste($title, $page, $file, $options, $sortfield, $sortorder, $morehtmlcenter, $num, $totalnboflines, $picto, $pictoisfullpath, $morehtmlright, $morecss, $limit, $selectlimitsuffix, $hidenavigation, $pagenavastextinput, $morehtmlrightbeforearrow);',
199 echo $documentation->showCode($lines,
'php'); ?>
208$documentation->docFooter();
Class to manage UI documentation.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.