dolibarr 21.0.0-beta
tables.php
1<?php
2/*
3 * Copyright (C) 2024 Anthony Damhet <a.damhet@progiseize.fr>
4 *
5 * This program and files/directory inner it is free software: you can
6 * redistribute it and/or modify it under the terms of the
7 * GNU Affero General Public License (AGPL) as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU AGPL for more details.
15 *
16 * You should have received a copy of the GNU AGPL
17 * along with this program. If not, see <https://www.gnu.org/licenses/agpl-3.0.html>.
18 */
19
20$res=0;
21if (! $res && file_exists("../../main.inc.php")) {
22 $res=@include '../../main.inc.php';
23}
24if (! $res && file_exists("../../../main.inc.php")) {
25 $res=@include '../../../main.inc.php';
26}
27if (! $res && file_exists("../../../../main.inc.php")) {
28 $res=@include '../../../../main.inc.php';
29}
30
31// Protection if external user
32if ($user->socid > 0) {
34}
35
36// Includes
37dol_include_once('admin/tools/ui/class/documentation.class.php');
38
39// Load documentation translations
40$langs->load('uxdocumentation');
41
42// Hooks
43$hookmanager->initHooks(array('uidocumentation'));
44
45//
46$documentation = new Documentation($db);
47
48// Output html head + body - Param is Title
49$documentation->docHeader('Tables');
50
51// Set view for menu and breadcrumb
52// Menu must be set in constructor of documentation class
53$documentation->view = array('Content','Tables');
54
55// Output sidebar
56$documentation->showSidebar(); ?>
57
58<div class="doc-wrapper">
59
60 <?php $documentation->showBreadCrumb(); ?>
61
62 <div class="doc-content-wrapper">
63
64 <h1 class="documentation-title"><?php echo $langs->trans('DocTableTitle'); ?></h1>
65 <p class="documentation-text"><?php echo $langs->trans('Description'); ?></p>
66
67 <!-- Summary -->
68 <?php $documentation->showSummary(); ?>
69
70 <!-- Basic usage -->
71 <div class="documentation-section" id="tablesection-basicusage">
72
73 <h2 class="documentation-title">Table with a title line</h2>
74
75 <p class="documentation-text"><?php echo $langs->trans('DocTableBasicDescription'); ?></p>
76 <div class="documentation-example">
77 <div class="div-table-responsive">
78 <table class="tagtable noborder liste nobottomiftotal">
79 <tr class="liste_titre">
80 <th class="wrapcolumntitle left liste_titre" title="First Name">First Name</th>
81 <th class="wrapcolumntitle left liste_titre" title="Last Name">Last Name</th>
82 <th class="wrapcolumntitle center liste_titre" title="Age">Age</th>
83 <th class="wrapcolumntitle right liste_titre" title="Country">Country</th>
84 </tr>
85 <tr class="oddeven">
86 <td class="left">John</td>
87 <td class="left">Doe</td>
88 <td class="center">37</td>
89 <td class="right">U.S.A</td>
90 </tr>
91 <tr class="oddeven">
92 <td class="left">Jack</td>
93 <td class="left">Sparrow</td>
94 <td class="center">29</td>
95 <td class="right">Caribbean</td>
96 </tr>
97 <tr class="oddeven">
98 <td class="left">Sacha</td>
99 <td class="left">Ketchum</td>
100 <td class="center">16</td>
101 <td class="right">Kanto</td>
102 </tr>
103 <tr class="oddeven">
104 <td class="left">Albert</td>
105 <td class="left">Einstein</td>
106 <td class="center">72</td>
107 <td class="right">Germany</td>
108 </tr>
109 </table>
110 </div>
111 </div>
112 <?php
113 $lines = array(
114 );
115 echo $documentation->showCode($lines); ?>
116 </div>
117
118 <!-- Table with filters -->
119 <div class="documentation-section" id="tablesection-withfilters">
120
121 <h2 class="documentation-title">Table with a filter line and title line</h2>
122
123 <p class="documentation-text"><?php echo $langs->trans('DocTableWithFiltersDescription'); ?></p>
124 <div class="documentation-example">
125 <div class="div-table-responsive">
126 <table class="tagtable noborder nobottomiftotal liste">
127 <tr class="liste_titre_filter">
128 <td><input></td>
129 <td></td>
130 <td></td>
131 <td></td>
132 </tr>
133 <tr class="liste_titre">
134 <th class="wrapcolumntitle left liste_titre" title="First Name">First Name</th>
135 <th class="wrapcolumntitle left liste_titre" title="Last Name">Last Name</th>
136 <th class="wrapcolumntitle center liste_titre" title="Age">Age</th>
137 <th class="wrapcolumntitle right liste_titre" title="Country">Country</th>
138 </tr>
139 <tr class="oddeven">
140 <td class="left">John</td>
141 <td class="left">Doe</td>
142 <td class="center">37</td>
143 <td class="right">U.S.A</td>
144 </tr>
145 <tr class="oddeven">
146 <td class="left">Jack</td>
147 <td class="left">Sparrow</td>
148 <td class="center">29</td>
149 <td class="right">Caribbean</td>
150 </tr>
151 <tr class="oddeven">
152 <td class="left">Sacha</td>
153 <td class="left">Ketchum</td>
154 <td class="center">16</td>
155 <td class="right">Kanto</td>
156 </tr>
157 <tr class="oddeven">
158 <td class="left">Albert</td>
159 <td class="left">Einstein</td>
160 <td class="center">72</td>
161 <td class="right">Germany</td>
162 </tr>
163 </table>
164 </div>
165 </div>
166 <?php
167 $lines = array(
168 );
169 echo $documentation->showCode($lines); ?>
170 </div>
171
172
173 <!-- Table with no filter and no title line -->
174 <div class="documentation-section" id="tablesection-withfilters">
175
176 <h2 class="documentation-title">Table with no filter, no title line</h2>
177
178 <p class="documentation-text"><?php echo $langs->trans('Description'); ?></p>
179 <div class="documentation-example">
180 <div class="div-table-responsive">
181 <table class="tagtable noborder nobottomiftotal liste">
182 <tr class="oddeven trfirstline">
183 <td class="left">John</td>
184 <td class="left">Doe</td>
185 <td class="center">37</td>
186 <td class="right">U.S.A</td>
187 </tr>
188 <tr class="oddeven">
189 <td class="left">Jack</td>
190 <td class="left">Sparrow</td>
191 <td class="center">29</td>
192 <td class="right">Caribbean</td>
193 </tr>
194 <tr class="oddeven">
195 <td class="left">Sacha</td>
196 <td class="left">Ketchum</td>
197 <td class="center">16</td>
198 <td class="right">Kanto</td>
199 </tr>
200 <tr class="oddeven trlastline">
201 <td class="left">Albert</td>
202 <td class="left">Einstein</td>
203 <td class="center">72</td>
204 <td class="right">Germany</td>
205 </tr>
206 </table>
207 </div>
208 </div>
209 <?php
210 $lines = array(
211 );
212 echo $documentation->showCode($lines); ?>
213 </div>
214
215 </div>
216
217 </div>
218
219<?php
220// Output close body + html
221$documentation->docFooter();
222?>
Class to manage UI documentation.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
treeview li table
No Email.
usage($program, $header)
Print the usage when executing scripts from install/.
Definition inc.php:94
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.