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