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