dolibarr 21.0.0-alpha
ajaxdirtree.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2018 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License 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 General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
27// This script is called with a POST method.
28// Directory to scan (full path) is inside POST['dir'] and encode by js escape() if ajax is used or encoded by urlencode if mode=noajax
29
30if (!defined('NOTOKENRENEWAL')) {
31 define('NOTOKENRENEWAL', 1); // Disables token renewal
32}
33if (!defined('NOREQUIREMENU')) {
34 define('NOREQUIREMENU', '1');
35}
36if (!defined('NOREQUIREHTML')) {
37 define('NOREQUIREHTML', '1');
38}
39if (!defined('NOREQUIREAJAX')) {
40 define('NOREQUIREAJAX', '1');
41}
42
43if (!isset($mode) || $mode != 'noajax') { // For ajax call
44 $res = @include '../../main.inc.php';
45 include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
46 include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
47 include_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
48 include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
49 include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
50
51 $openeddir = GETPOST('openeddir');
52 $modulepart = GETPOST('modulepart');
53 $selecteddir = jsUnEscape(GETPOST('dir')); // relative path. We must decode using same encoding function used by javascript: escape()
54
55 $preopened = GETPOST('preopened');
56
57 if ($selecteddir != '/') {
58 $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/'
59 }
60} else {
61 // For no ajax call
62
63 $openeddir = GETPOST('openeddir');
64 $modulepart = GETPOST('modulepart');
65 $selecteddir = GETPOST('dir');
66
67 $preopened = GETPOST('preopened');
68
69 if ($selecteddir != '/') {
70 $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/'
71 }
72 if (empty($url)) {
73 $url = DOL_URL_ROOT.'/ecm/index.php';
74 }
75}
76
77$websitekey = GETPOST('websitekey', 'alpha');
78$pageid = GETPOSTINT('pageid');
79
80// Load translation files required by the page
81$langs->load("ecm");
82
83// Define fullpathselecteddir.
84$fullpathselecteddir = '<none>';
85if ($modulepart == 'ecm') {
86 $fullpathselecteddir = $conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : '');
87 $fullpathpreopened = $conf->ecm->dir_output.'/'.($preopened != '/' ? $preopened : '');
88} elseif ($modulepart == 'medias' || $modulepart == 'website') {
89 $fullpathselecteddir = $dolibarr_main_data_root.'/medias/'.($selecteddir != '/' ? $selecteddir : '');
90 $fullpathpreopened = $dolibarr_main_data_root.'/medias/'.($preopened != '/' ? $preopened : '');
91}
92
93
94// Security:
95// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers.
96if (preg_match('/\.\./', $fullpathselecteddir) || preg_match('/[<>|]/', $fullpathselecteddir)) {
97 dol_syslog("Refused to deliver file ".$original_file);
98 // Do no show plain path in shown error message
99 dol_print_error(null, $langs->trans("ErrorFileNameInvalid", GETPOST("file")));
100 exit;
101}
102
103if (empty($modulepart)) {
104 $modulepart = $module;
105}
106
107// Security check
108if ($modulepart == 'ecm') {
109 if (!$user->hasRight('ecm', 'read')) {
111 }
112} elseif ($modulepart == 'medias' || $modulepart == 'website') {
113 // Always allowed
114} else {
116}
117
118
119/*
120 * Actions
121 */
122
123// None
124
125
126/*
127 * View
128 */
129
130if (!isset($mode) || $mode != 'noajax') { // if ajax mode
131 top_httphead();
132}
133
134//print '<!-- selecteddir (relative dir we click on) = '.$selecteddir.', openeddir = '.$openeddir.', modulepart='.$modulepart.', preopened='.$preopened.' -->'."\n";
135$userstatic = new User($db);
136$form = new Form($db);
137$ecmdirstatic = new EcmDirectory($db);
138
139// Load full manual tree of ECM module from database. We will use it to define nbofsubdir and nboffilesinsubdir
140if (empty($sqltree)) {
141 $sqltree = $ecmdirstatic->get_full_arbo(0);
142}
143
144// Try to find selected dir id into $sqltree and save it into $current_ecmdir_id
145$current_ecmdir_id = -1;
146foreach ($sqltree as $keycursor => $val) {
147 //print $val['fullrelativename']." == ".$selecteddir;
148 if ($val['fullrelativename'] == $selecteddir) {
149 $current_ecmdir_id = $keycursor;
150 }
151}
152
153if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
154 //
155 treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened);
156
157 // TODO Find a solution to not output this code for each leaf we open
158 // Enable jquery handlers on new generated HTML objects (same code than into lib_footer.js.php)
159 // Because the content is reloaded by ajax call, we must also reenable some jquery hooks
160 print "\n<!-- JS CODE TO ENABLE Tooltips on all object with class classfortooltip (reload into ajaxdirtree) -->\n";
161 print '<script nonce="'.getNonce().'" type="text/javascript">
162 jQuery(document).ready(function () {
163 jQuery(".classfortooltip").tooltip({
164 show: { collision: "flipfit", effect:\'toggle\', delay:50 },
165 hide: { delay: 50 }, /* If I enable effect:\'toggle\' here, a bug appears: the tooltip is shown when collapsing a new dir if it was shown before */
166 tooltipClass: "mytooltip",
167 content: function () {
168 return $(this).prop(\'title\'); /* To force to get title as is */
169 }
170 });
171 });
172 </script>';
173
174 // This ajax service is called only when a directory $selecteddir is opened but not when closed.
175 //print '<script nonce="'.getNonce().'" type="text/javascript">';
176 //print "loadandshowpreview('".dol_escape_js($selecteddir)."');";
177 //print '</script>';
178}
179
180
181if (empty($conf->use_javascript_ajax) || getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
182 print '<ul class="ecmjqft">';
183
184 // Load full manual tree from database. We will use it to define nbofsubdir and nboffilesinsubdir
185 if (empty($sqltree)) {
186 $sqltree = $ecmdirstatic->get_full_arbo(0); // Slow
187 }
188
189 // ----- This section will show a tree from a fulltree array -----
190 // $section must also be defined
191 // ----------------------------------------------------------------
192
193 // Define fullpathselected ( _x_y_z ) of $section parameter (!! not into ajaxdirtree)
194 $fullpathselected = '';
195 foreach ($sqltree as $key => $val) {
196 //print $val['id']."-".$section."<br>";
197 if ($val['id'] == $section) {
198 $fullpathselected = $val['fullpath'];
199 break;
200 }
201 }
202 //print "fullpathselected=".$fullpathselected."<br>";
203
204 // Update expandedsectionarray in session
205 $expandedsectionarray = array();
206 if (isset($_SESSION['dol_ecmexpandedsectionarray'])) {
207 $expandedsectionarray = explode(',', $_SESSION['dol_ecmexpandedsectionarray']);
208 }
209
210 if ($section && GETPOST('sectionexpand') == 'true') {
211 // We add all sections that are parent of opened section
212 $pathtosection = explode('_', $fullpathselected);
213 foreach ($pathtosection as $idcursor) {
214 if ($idcursor && !in_array($idcursor, $expandedsectionarray)) { // Not already in array
215 $expandedsectionarray[] = $idcursor;
216 }
217 }
218 $_SESSION['dol_ecmexpandedsectionarray'] = implode(',', $expandedsectionarray);
219 }
220 if ($section && GETPOST('sectionexpand') == 'false') {
221 // We removed all expanded sections that are child of the closed section
222 $oldexpandedsectionarray = $expandedsectionarray;
223 $expandedsectionarray = array(); // Reset
224 // @phan-suppress-next-line PhanEmptyForeachBody
225 foreach ($oldexpandedsectionarray as $sectioncursor) {
226 // TODO is_in_subtree(fulltree,sectionparent,sectionchild) does nox exists. Enable or remove this...
227 //if ($sectioncursor && ! is_in_subtree($sqltree,$section,$sectioncursor)) $expandedsectionarray[]=$sectioncursor;
228 }
229 $_SESSION['dol_ecmexpandedsectionarray'] = implode(',', $expandedsectionarray);
230 }
231 //print $_SESSION['dol_ecmexpandedsectionarray'].'<br>';
232
233 $nbofentries = 0;
234 $oldvallevel = 0;
235 foreach ($sqltree as $key => $val) {
236 $ecmdirstatic->id = $val['id'];
237 $ecmdirstatic->ref = $val['label'];
238
239 // Refresh cache
240 if (preg_match('/refresh/i', $action)) {
241 $result = $ecmdirstatic->fetch($val['id']);
242 $ecmdirstatic->ref = $ecmdirstatic->label;
243
244 $result = $ecmdirstatic->refreshcachenboffile(0);
245 $val['cachenbofdoc'] = $result;
246 }
247
248 //$fullpathparent=preg_replace('/(_[^_]+)$/i','',$val['fullpath']);
249
250 // Define showline
251 $showline = 0;
252
253 // If directory is son of expanded directory, we show line
254 if (in_array($val['id_mere'], $expandedsectionarray)) {
255 $showline = 4;
256 } elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) {
257 // If directory is brother of selected directory, we show line
258 $showline = 3;
259 } elseif (preg_match('/'.$val['fullpath'].'_/i', $fullpathselected.'_')) {
260 // If directory is parent of selected directory or is selected directory, we show line
261 $showline = 2;
262 } elseif ($val['level'] < 2) {
263 // If we are level one we show line
264 $showline = 1;
265 }
266
267 if ($showline) {
268 if (in_array($val['id'], $expandedsectionarray)) {
269 $option = 'indexexpanded';
270 } else {
271 $option = 'indexnotexpanded';
272 }
273 //print $option;
274
275 print '<li class="directory collapsed">';
276
277 // Show tree graph pictos
278 $cpt = 1;
279 while ($cpt < $sqltree[$key]['level']) {
280 print ' &nbsp; &nbsp;';
281 $cpt++;
282 }
283 $resarray = tree_showpad($sqltree, $key, 1);
284 $a = $resarray[0];
285 $nbofsubdir = $resarray[1];
286 $nboffilesinsubdir = $resarray[2];
287
288 // Show link
289 print $ecmdirstatic->getNomUrl(0, $option, 32, 'class="fmdirlia jqft ecmjqft"');
290
291 print '<div class="ecmjqft">';
292
293 // Nb of docs
294 print '<table class="nobordernopadding"><tr>';
295
296 print '<!-- nb of docs -->';
297 print '<td>';
298 print $val['cachenbofdoc'];
299 print '</td>';
300
301 print '<!-- nb in subdir -->';
302 print '<td class="left">';
303 if ($nbofsubdir && $nboffilesinsubdir) {
304 print '<span style="color: #AAAAAA">+'.$nboffilesinsubdir.'</span> ';
305 }
306 print '</td>';
307
308 // Info
309 print '<!-- info -->';
310 print '<td class="center">';
311 $userstatic->id = $val['fk_user_c'];
312 $userstatic->lastname = $val['login_c'];
313 $userstatic->status = $val['statut_c'];
314 $htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
315 $htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
316 $htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
317 $htmltooltip .= '<b>'.$langs->trans("ECMCreationDate").'</b>: '.dol_print_date($val['date_c'], "dayhour").'<br>';
318 $htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
319 $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>';
320 if ($nbofsubdir) {
321 $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
322 } else {
323 $htmltooltip .= '<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.$nbofsubdir.'<br>';
324 }
325 print $form->textwithpicto('', $htmltooltip, 1, 'info');
326 print "</td>";
327
328 print '</tr></table>';
329
330 print '</div>';
331
332 print "</li>\n";
333 }
334
335 $oldvallevel = $val['level'];
336 $nbofentries++;
337 }
338
339 // If nothing to show
340 if ($nbofentries == 0) {
341 print '<li class="directory collapsed">';
342 print '<div class="ecmjqft">';
343 print $langs->trans("ECMNoDirectoryYet");
344 print '</div>';
345 print "</li>\n";
346 }
347
348 print '</ul>';
349}
350
351
352// Close db if mode is not noajax
353if ((!isset($mode) || $mode != 'noajax') && is_object($db)) {
354 $db->close();
355}
356
357
358
373function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth = 0)
374{
375 global $conf, $db, $langs, $form, $user;
376 global $dolibarr_main_data_root;
377
378 $ecmdirstatic = new EcmDirectory($db);
379 $userstatic = new User($db);
380
381 if (file_exists($fullpathselecteddir)) {
382 $files = @scandir($fullpathselecteddir);
383
384 if (!empty($files)) { // array should have at least . and ..
385 natcasesort($files);
386 if (count($files) > 2) { /* The 2 accounts for . and .. */
387 echo '<ul class="ecmjqft" style="display: none;">'."\n";
388
389 // All dirs
390 $nboflinesshown = 0;
391 foreach ($files as $file) {
392 // $file can be '.', '..', 'temp', or 'My dir' or 'My file'
393 if (in_array($file, array('temp', '.', '..'))) {
394 continue;
395 }
396
397 // External users are not allowed to see manual directories so we quit.
398 // TODO Implement acl on directory for user groups.
399 if ($user->socid > 0) {
400 break;
401 }
402
403 $nbofsubdir = 0;
404 $nboffilesinsubdir = 0;
405
406 $val = array();
407
408 // Loop on all database entries (sqltree) to find the one matching the subdir found into dir to scan
409 foreach ($sqltree as $key => $tmpval) {
410 //print "-- key=".$key." - ".$tmpval['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file)."<br>\n";
411 if ($tmpval['fullrelativename'] == (($selecteddir != '/' ? $selecteddir.'/' : '').$file)) { // We found equivalent record into database
412 $val = $tmpval;
413 $resarray = tree_showpad($sqltree, $key, 1);
414
415 // Refresh cache for this subdir
416 if (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] < 0) { // Cache is not up to date, so we update it for this directory t
417 $result = $ecmdirstatic->fetch($val['id']);
418 $ecmdirstatic->ref = $ecmdirstatic->label;
419
420 $result = $ecmdirstatic->refreshcachenboffile(0);
421 $val['cachenbofdoc'] = $result;
422 }
423
424 $a = $resarray[0];
425 $nbofsubdir = $resarray[1];
426 $nboffilesinsubdir = $resarray[2];
427 break;
428 }
429 }
430
431 //print 'modulepart='.$modulepart.' fullpathselecteddir='.$fullpathselecteddir.' - val[fullrelativename] (in database)='.$val['fullrelativename'].' - val[id]='.$val['id'].' - is_dir='.dol_is_dir($fullpathselecteddir . $file).' - file='.$file."\n";
432 if ((!empty($val['fullrelativename']) && $val['id'] >= 0) || dol_is_dir($fullpathselecteddir.(preg_match('/\/$/', $fullpathselecteddir) ? '' : '/').$file)) {
433 if (empty($val['fullrelativename'])) { // If we did not find entry into database, but found a directory (dol_is_dir was ok at previous test)
434 $val['fullrelativename'] = (($selecteddir && $selecteddir != '/') ? $selecteddir.'/' : '').$file;
435 $val['id'] = 0;
436 $val['label'] = $file;
437 $val['description'] = '';
438 $nboffilesinsubdir = $langs->trans("Unknown");
439 }
440
441 $collapsedorexpanded = 'collapsed';
442 if (preg_match('/^'.preg_quote($val['fullrelativename'].'/', '/').'/', $preopened)) {
443 $collapsedorexpanded = 'expanded';
444 }
445
446 $nboflinesshown++;
447
448 print '<li class="directory '.$collapsedorexpanded.' lidirecm">'; // collapsed is opposite if expanded
449
450 //print '<div class="divfmdirlia inline-block">'; // Disabled, this break the javascrip component
451 print '<a class="fmdirlia jqft ecmjqft" href="';
452 print "#";
453 print "\" rel=\"".dol_escape_htmltag($val['fullrelativename'].'/')."\" id=\"fmdirlia_id_".$val['id']."\"";
454 print " onClick=\"loadandshowpreview('".dol_escape_js($val['fullrelativename'])."',".$val['id'].")";
455 print "\">";
456 print dol_escape_htmltag($file);
457 print '</a>';
458 //print '</div>';
459
460 print '<div class="ecmjqft">';
461
462 print '<table class="nobordernopadding"><tr>';
463
464 /*print '<td class="left">';
465 print dol_escape_htmltag($file);
466 print '</td>';*/
467
468 // Nb of docs
469 print '<!-- nb of docs -->';
470 print '<td class="right">';
471 print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : '&nbsp;';
472 print '</td>';
473
474 print '<!-- nb of subdirs -->';
475 print '<td class="left">';
476 if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) {
477 print '<span class="opacitymedium">+'.$nboffilesinsubdir.'</span> ';
478 }
479 print '</td>';
480
481 // Edit link
482 print '<!-- edit link -->';
483 print '<td class="right" width="18"><a class="editfielda" href="';
484 print DOL_URL_ROOT.'/ecm/dir_card.php?module='.urlencode($modulepart).'&section='.$val['id'].'&relativedir='.urlencode($val['fullrelativename']);
485 print '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid);
486 print '">'.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').'</a></td>';
487
488 // Add link
489 //print '<td class="right"><a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>';
490 //print '<td class="right" width="14">&nbsp;</td>';
491
492 // Info
493 if ($modulepart == 'ecm') {
494 print '<!-- info -->';
495 print '<td class="right" width="18">';
496 $userstatic->id = isset($val['fk_user_c']) ? $val['fk_user_c'] : 0;
497 $userstatic->lastname = isset($val['login_c']) ? $val['login_c'] : 0;
498 $userstatic->status = isset($val['statut_c']) ? $val['statut_c'] : 0;
499 $htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
500 $htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
501 $htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
502 $htmltooltip .= '<b>'.$langs->trans("ECMCreationDate").'</b>: '.(isset($val['date_c']) ? dol_print_date($val['date_c'], "dayhour") : $langs->trans("NeedRefresh")).'<br>';
503 $htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
504 $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.((isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : $langs->trans("NeedRefresh")).'<br>';
505 if ($nboffilesinsubdir > 0) {
506 $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
507 } else {
508 $htmltooltip .= '<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.($nbofsubdir >= 0 ? $nbofsubdir : $langs->trans("NeedRefresh")).'<br>';
509 }
510 print $form->textwithpicto('', $htmltooltip, 1, "info");
511 print "</td>";
512 }
513
514 print "</tr></table>\n";
515 print '</div>';
516
517 //print 'selecteddir='.$selecteddir.' preopened='.$preopened.' $val[\'fullrelativename\']='.$val['fullrelativename']."<br>\n";
518 if (preg_match('/^'.preg_quote($val['fullrelativename'].'/', '/').'/', $preopened)) {
519 //print 'modulepart='.$modulepart.' fullpathselecteddir='.$fullpathselecteddir.' - val[fullrelativename] (in database)='.$val['fullrelativename'].' - val[id]='.$val['id'].' - is_dir='.dol_is_dir($fullpathselecteddir . $file).' - file='.$file."\n";
520 $newselecteddir = $val['fullrelativename'];
521 $newfullpathselecteddir = '';
522 if ($modulepart == 'ecm') {
523 $newfullpathselecteddir = $conf->ecm->dir_output.'/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : '');
524 } elseif ($modulepart == 'medias') {
525 $newfullpathselecteddir = $dolibarr_main_data_root.'/medias/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : '');
526 }
527
528 if ($newfullpathselecteddir) {
529 treeOutputForAbsoluteDir($sqltree, $newselecteddir, $newfullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth + 1);
530 }
531 }
532
533 print "</li>\n";
534 }
535 }
536
537 if ($user->socid > 0 && empty($nboflinesshown)) {
538 // External users are not allowed to see manual directories
539 print '<li>Not directory allowed to external users.<br>ACL for external users not yet implemented.</li>';
540 }
541
542 echo "</ul>\n";
543 }
544 } else {
545 print "PermissionDenied";
546 }
547 }
548}
foreach($sqltree as $keycursor=> $val) if(!empty( $conf->use_javascript_ajax) &&!getDolGlobalString( 'MAIN_ECM_DISABLE_JS')) if(empty($conf->use_javascript_ajax)||getDolGlobalString('MAIN_ECM_DISABLE_JS')) if((!isset( $mode)||$mode !='noajax') &&is_object( $db)) treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth=0)
treeOutputForAbsoluteDir
Class to manage ECM directories.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
dol_is_dir($folder)
Test if filename is a directory.
jsUnEscape($source)
Same function than javascript unescape() function but in PHP.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
tree_showpad(&$fulltree, $key, $silent=0)
Show indent and picto of a tree line.