Subversion Repositories oidplus

Rev

Rev 721 | Rev 801 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 721 Rev 800
Line 176... Line 176...
176
                                        $file = str_replace(chr(0), '[NUL]', $file);
176
                                        $file = str_replace(chr(0), '[NUL]', $file);
177
                                }
177
                                }
178
                                // This will not be logged anymore, because people could spam the log files otherwise
178
                                // This will not be logged anymore, because people could spam the log files otherwise
179
                                //OIDplus::logger()->log("[WARN]A!", "LFI/RFI attack blocked (requested file '$file')");
179
                                //OIDplus::logger()->log("[WARN]A!", "LFI/RFI attack blocked (requested file '$file')");
180
                                $out['title'] = _L('Access denied');
180
                                $out['title'] = _L('Access denied');
181
                                $out['icon'] = 'img/error_big.png';
181
                                $out['icon'] = 'img/error.png';
182
                                $out['text'] = '<p>'._L('This request is invalid').'</p>';
182
                                $out['text'] = '<p>'._L('This request is invalid').'</p>';
183
                                return;
183
                                return;
184
                        }
184
                        }
185
 
185
 
186
                        $out['text'] = '';
186
                        $out['text'] = '';
Line 188... Line 188...
188
                        // Check for permission
188
                        // Check for permission
189
 
189
 
190
                        if ($file != '') {
190
                        if ($file != '') {
191
                                if (!self::mayAccessResource($file)) {
191
                                if (!self::mayAccessResource($file)) {
192
                                        $out['title'] = _L('Access denied');
192
                                        $out['title'] = _L('Access denied');
193
                                        $out['icon'] = 'img/error_big.png';
193
                                        $out['icon'] = 'img/error.png';
194
                                        $out['text'] = '<p>'._L('Authentication error. Please log in.').'</p>';
194
                                        $out['text'] = '<p>'._L('Authentication error. Please log in.').'</p>';
195
                                        return;
195
                                        return;
196
                                }
196
                                }
197
                        }
197
                        }
198
 
198
 
Line 211... Line 211...
211
 
211
 
212
                        if ($file != '') {
212
                        if ($file != '') {
213
                                $dir = dirname($file);
213
                                $dir = dirname($file);
214
 
214
 
215
                                if ($dir == '.') {
215
                                if ($dir == '.') {
216
                                        if (file_exists(__DIR__.'/treeicon.png')) {
216
                                        if (file_exists(__DIR__.'/img/main_icon16.png')) {
217
                                                $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
217
                                                $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
218
                                        } else {
218
                                        } else {
219
                                                $tree_icon = null; // default icon (folder)
219
                                                $tree_icon = null; // default icon (folder)
220
                                        }
220
                                        }
221
 
221
 
222
                                        $ic = empty($tree_icon) ? '' : '<img src="'.$tree_icon.'" alt="">';
222
                                        $ic = empty($tree_icon) ? '' : '<img src="'.$tree_icon.'" alt="">';
Line 224... Line 224...
224
                                        $lng_gobackto = _L('Go back to').':';
224
                                        $lng_gobackto = _L('Go back to').':';
225
                                        $out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:resources').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '.$lng_gobackto.' '.$ic.' '.htmlentities($this->getMainTitle()).'</a></p>';
225
                                        $out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:resources').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '.$lng_gobackto.' '.$ic.' '.htmlentities($this->getMainTitle()).'</a></p>';
226
                                } else {
226
                                } else {
227
                                        $realdir = self::realname($dir);
227
                                        $realdir = self::realname($dir);
228
 
228
 
229
                                        $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_folder&lang='.OIDplus::getCurrentLang().'&file='.urlencode($dir);
229
                                        $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=folder_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($dir);
230
                                        /*
230
                                        /*
231
                                        $icon_candidate = pathinfo($realdir)['dirname'].'/'.pathinfo($realdir)['filename'].'_tree.png';
231
                                        $icon_candidate = pathinfo($realdir)['dirname'].'/'.pathinfo($realdir)['filename'].'_tree.png';
232
                                        if (file_exists($icon_candidate)) {
232
                                        if (file_exists($icon_candidate)) {
233
                                                $tree_icon = $icon_candidate;
233
                                                $tree_icon = $icon_candidate;
234
                                        } else if (file_exists(__DIR__.'/treeicon_folder.png')) {
234
                                        } else if (file_exists(__DIR__.'/img/folder_icon16.png')) {
235
                                                $tree_icon = OIDplus::webpath(__DIR__).'treeicon_folder.png';
235
                                                $tree_icon = OIDplus::webpath(__DIR__,true).'img/folder_icon16.png';
236
                                        } else {
236
                                        } else {
237
                                                $tree_icon = null; // no icon
237
                                                $tree_icon = null; // no icon
238
                                        }
238
                                        }
239
                                        */
239
                                        */
240
 
240
 
Line 252... Line 252...
252
 
252
 
253
                        if (file_exists($realfile) && (!is_dir($realfile))) {
253
                        if (file_exists($realfile) && (!is_dir($realfile))) {
254
                                if ((substr($file,-4,4) == '.url') || (substr($file,-5,5) == '.link')) {
254
                                if ((substr($file,-4,4) == '.url') || (substr($file,-5,5) == '.link')) {
255
                                        $out['title'] = $this->getHyperlinkTitle($realfile);
255
                                        $out['title'] = $this->getHyperlinkTitle($realfile);
256
 
256
 
257
                                        $out['icon'] = OIDplus::webpath(__DIR__).'show_icon.php?mode=icon_leaf_url_big&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
257
                                        $out['icon'] = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=leaf_url_icon&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
258
                                        /*
258
                                        /*
259
                                        $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_big.png';
259
                                        $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_big.png';
260
                                        if (file_exists($icon_candidate)) {
260
                                        if (file_exists($icon_candidate)) {
261
                                                $out['icon'] = $icon_candidate;
261
                                                $out['icon'] = $icon_candidate;
262
                                        } else if (file_exists(__DIR__.'/icon_leaf_url_big.png')) {
262
                                        } else if (file_exists(__DIR__.'/img/leaf_url_icon.png')) {
263
                                                $out['icon'] = OIDplus::webpath(__DIR__).'icon_leaf_url_big.png';
263
                                                $out['icon'] = OIDplus::webpath(__DIR__,true).'img/leaf_url_icon.png';
264
                                        } else {
264
                                        } else {
265
                                                $out['icon'] = '';
265
                                                $out['icon'] = '';
266
                                        }
266
                                        }
267
                                        */
267
                                        */
268
 
268
 
269
                                        // Should not happen though, due to conditionalselect
269
                                        // Should not happen though, due to conditionalselect
270
                                        $out['text'] .= '<a href="'.htmlentities(self::getHyperlinkURL($realfile)).'" target="_blank">'._L('Open in new window').'</a>';
270
                                        $out['text'] .= '<a href="'.htmlentities(self::getHyperlinkURL($realfile)).'" target="_blank">'._L('Open in new window').'</a>';
271
                                } else if ((substr($file,-4,4) == '.htm') || (substr($file,-5,5) == '.html')) {
271
                                } else if ((substr($file,-4,4) == '.htm') || (substr($file,-5,5) == '.html')) {
272
                                        $out['title'] = $this->getDocumentTitle($file);
272
                                        $out['title'] = $this->getDocumentTitle($file);
273
 
273
 
274
                                        $out['icon'] = OIDplus::webpath(__DIR__).'show_icon.php?mode=icon_leaf_doc_big&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
274
                                        $out['icon'] = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=leaf_doc_icon&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
275
                                        /*
275
                                        /*
276
                                        $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_big.png';
276
                                        $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_big.png';
277
                                        if (file_exists($icon_candidate)) {
277
                                        if (file_exists($icon_candidate)) {
278
                                                $out['icon'] = $icon_candidate;
278
                                                $out['icon'] = $icon_candidate;
279
                                        } else if (file_exists(__DIR__.'/icon_leaf_doc_big.png')) {
279
                                        } else if (file_exists(__DIR__.'/img/leaf_doc_icon.png')) {
280
                                                $out['icon'] = OIDplus::webpath(__DIR__).'icon_leaf_doc_big.png';
280
                                                $out['icon'] = OIDplus::webpath(__DIR__,true).'img/leaf_doc_icon.png';
281
                                        } else {
281
                                        } else {
282
                                                $out['icon'] = '';
282
                                                $out['icon'] = '';
283
                                        }
283
                                        }
284
                                        */
284
                                        */
285
 
285
 
286
                                        $out['text'] .= self::getDocumentContent($file);
286
                                        $out['text'] .= self::getDocumentContent($file);
287
                                } else {
287
                                } else {
288
                                        $out['title'] = _L('Unknown file type');
288
                                        $out['title'] = _L('Unknown file type');
289
                                        $out['icon'] = 'img/error_big.png';
289
                                        $out['icon'] = 'img/error.png';
290
                                        $out['text'] = '<p>'._L('The system does not know how to handle this file type.').'</p>';
290
                                        $out['text'] = '<p>'._L('The system does not know how to handle this file type.').'</p>';
291
                                        return;
291
                                        return;
292
                                }
292
                                }
293
                        } else if (is_dir($realfile)) {
293
                        } else if (is_dir($realfile)) {
294
                                $out['title'] = ($file == '') ? $this->getMainTitle() : self::getFolderTitle($realfile);
294
                                $out['title'] = ($file == '') ? $this->getMainTitle() : self::getFolderTitle($realfile);
295
 
295
 
296
                                if ($file == '') {
296
                                if ($file == '') {
297
                                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
297
                                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
298
                                } else {
298
                                } else {
299
                                        $out['icon'] = OIDplus::webpath(__DIR__).'show_icon.php?mode=icon_folder_big&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
299
                                        $out['icon'] = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=folder_icon&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
300
                                        /*
300
                                        /*
301
                                        $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_big.png';
301
                                        $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_big.png';
302
                                        if (file_exists($icon_candidate)) {
302
                                        if (file_exists($icon_candidate)) {
303
                                                $out['icon'] = $icon_candidate;
303
                                                $out['icon'] = $icon_candidate;
304
                                        } else if (file_exists(__DIR__.'/icon_folder_big.png')) {
304
                                        } else if (file_exists(__DIR__.'/img/folder_icon.png')) {
305
                                                $out['icon'] = OIDplus::webpath(__DIR__).'icon_folder_big.png';
305
                                                $out['icon'] = OIDplus::webpath(__DIR__,true).'img/folder_icon.png';
306
                                        } else {
306
                                        } else {
307
                                                $out['icon'] = null; // no icon
307
                                                $out['icon'] = null; // no icon
308
                                        }
308
                                        }
309
                                        */
309
                                        */
310
                                }
310
                                }
311
 
311
 
312
                                if (file_exists(__DIR__.'/treeicon.png')) {
312
                                if (file_exists(__DIR__.'/img/main_icon16.png')) {
313
                                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
313
                                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
314
                                } else {
314
                                } else {
315
                                        $tree_icon = null; // default icon (folder)
315
                                        $tree_icon = null; // default icon (folder)
316
                                }
316
                                }
317
 
317
 
318
                                $count = 0;
318
                                $count = 0;
319
 
319
 
320
                                $dirs = self::myglob(rtrim($file,'/').'/'.'*', true);
320
                                $dirs = self::myglob(rtrim($file,'/').'/'.'*', true);
321
                                natcasesort($dirs);
321
                                natcasesort($dirs);
322
                                foreach ($dirs as $dir) {
322
                                foreach ($dirs as $dir) {
323
                                        $realdir = self::realname($dir);
323
                                        $realdir = self::realname($dir);
324
                                        $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_folder&lang='.OIDplus::getCurrentLang().'&file='.urlencode($dir);
324
                                        $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=folder_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($dir);
325
                                        /*
325
                                        /*
326
                                        $icon_candidate = pathinfo($realdir)['dirname'].'/'.pathinfo($realdir)['filename'].'_tree.png';
326
                                        $icon_candidate = pathinfo($realdir)['dirname'].'/'.pathinfo($realdir)['filename'].'_tree.png';
327
                                        if (file_exists($icon_candidate)) {
327
                                        if (file_exists($icon_candidate)) {
328
                                                $tree_icon = $icon_candidate;
328
                                                $tree_icon = $icon_candidate;
329
                                        } else if (file_exists(__DIR__.'/treeicon_folder.png')) {
329
                                        } else if (file_exists(__DIR__.'/img/folder_icon16.png')) {
330
                                                $tree_icon = OIDplus::webpath(__DIR__).'treeicon_folder.png';
330
                                                $tree_icon = OIDplus::webpath(__DIR__,true).'img/folder_icon16.png';
331
                                        } else {
331
                                        } else {
332
                                                $tree_icon = null; // no icon
332
                                                $tree_icon = null; // no icon
333
                                        }
333
                                        }
334
                                        */
334
                                        */
335
 
335
 
Line 347... Line 347...
347
                                );
347
                                );
348
                                natcasesort($files);
348
                                natcasesort($files);
349
                                foreach ($files as $file) {
349
                                foreach ($files as $file) {
350
                                        $realfile = self::realname($file);
350
                                        $realfile = self::realname($file);
351
                                        if ((substr($file,-4,4) == '.url') || (substr($file,-5,5) == '.link')) {
351
                                        if ((substr($file,-4,4) == '.url') || (substr($file,-5,5) == '.link')) {
352
                                                $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_leaf_url&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
352
                                                $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=leaf_url_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
353
                                                /*
353
                                                /*
354
                                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
354
                                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
355
                                                if (file_exists($icon_candidate)) {
355
                                                if (file_exists($icon_candidate)) {
356
                                                        $tree_icon = $icon_candidate;
356
                                                        $tree_icon = $icon_candidate;
357
                                                } else if (file_exists(__DIR__.'/treeicon_leaf_url.png')) {
357
                                                } else if (file_exists(__DIR__.'/img/leaf_url_icon16.png')) {
358
                                                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon_leaf_url.png';
358
                                                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/leaf_url_icon16.png';
359
                                                } else {
359
                                                } else {
360
                                                        $tree_icon = null; // default icon (folder)
360
                                                        $tree_icon = null; // default icon (folder)
361
                                                }
361
                                                }
362
                                                */
362
                                                */
363
 
363
 
364
                                                $ic = /*empty($tree_icon) ? '' : */'<img src="'.$tree_icon.'" alt="">';
364
                                                $ic = /*empty($tree_icon) ? '' : */'<img src="'.$tree_icon.'" alt="">';
365
 
365
 
366
                                                $out['text'] .= '<p><a href="'.htmlentities(self::getHyperlinkURL($realfile)).'" target="_blank">'.$ic.' '.htmlentities($this->getHyperlinkTitle($realfile)).'</a></p>';
366
                                                $out['text'] .= '<p><a href="'.htmlentities(self::getHyperlinkURL($realfile)).'" target="_blank">'.$ic.' '.htmlentities($this->getHyperlinkTitle($realfile)).'</a></p>';
367
                                                $count++;
367
                                                $count++;
368
                                        } else {
368
                                        } else {
369
                                                $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_leaf_doc&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
369
                                                $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=leaf_doc_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
370
                                                /*
370
                                                /*
371
                                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
371
                                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
372
                                                if (file_exists($icon_candidate)) {
372
                                                if (file_exists($icon_candidate)) {
373
                                                        $tree_icon = $icon_candidate;
373
                                                        $tree_icon = $icon_candidate;
374
                                                } else if (file_exists(__DIR__.'/treeicon_leaf_doc.png')) {
374
                                                } else if (file_exists(__DIR__.'/img/leaf_doc_icon16.png')) {
375
                                                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon_leaf_doc.png';
375
                                                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/leaf_doc_icon16.png';
376
                                                } else {
376
                                                } else {
377
                                                        $tree_icon = null; // default icon (folder)
377
                                                        $tree_icon = null; // default icon (folder)
378
                                                }
378
                                                }
379
                                                */
379
                                                */
380
 
380
 
Line 388... Line 388...
388
                                if ($count == 0) {
388
                                if ($count == 0) {
389
                                        $out['text'] .= '<p>'._L('This folder does not contain any elements').'</p>';
389
                                        $out['text'] .= '<p>'._L('This folder does not contain any elements').'</p>';
390
                                }
390
                                }
391
                        } else {
391
                        } else {
392
                                $out['title'] = _L('Not found');
392
                                $out['title'] = _L('Not found');
393
                                $out['icon'] = 'img/error_big.png';
393
                                $out['icon'] = 'img/error.png';
394
                                $out['text'] = '<p>'._L('This resource doesn\'t exist anymore.').'</p>';
394
                                $out['text'] = '<p>'._L('This resource doesn\'t exist anymore.').'</p>';
395
                        }
395
                        }
396
                }
396
                }
397
        }
397
        }
398
 
398
 
Line 407... Line 407...
407
 
407
 
408
                        $this->tree_rec($tmp, $dir, $depth+1);
408
                        $this->tree_rec($tmp, $dir, $depth+1);
409
 
409
 
410
                        $realdir = self::realname($dir);
410
                        $realdir = self::realname($dir);
411
 
411
 
412
                        $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_folder&lang='.OIDplus::getCurrentLang().'&file='.urlencode($dir);
412
                        $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=folder_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($dir);
413
                        /*
413
                        /*
414
                        $icon_candidate = pathinfo($realdir)['dirname'].'/'.pathinfo($realdir)['filename'].'_tree.png';
414
                        $icon_candidate = pathinfo($realdir)['dirname'].'/'.pathinfo($realdir)['filename'].'_tree.png';
415
                        if (file_exists($icon_candidate)) {
415
                        if (file_exists($icon_candidate)) {
416
                                $tree_icon = $icon_candidate;
416
                                $tree_icon = $icon_candidate;
417
                        } else if (file_exists(__DIR__.'/treeicon_folder.png')) {
417
                        } else if (file_exists(__DIR__.'/img/folder_icon16.png')) {
418
                                $tree_icon = OIDplus::webpath(__DIR__).'treeicon_folder.png';
418
                                $tree_icon = OIDplus::webpath(__DIR__,true).'img/folder_icon16.png';
419
                        } else {
419
                        } else {
420
                                $tree_icon = null; // default icon (folder)
420
                                $tree_icon = null; // default icon (folder)
421
                        }
421
                        }
422
                        */
422
                        */
423
 
423
 
Line 438... Line 438...
438
                );
438
                );
439
                natcasesort($files);
439
                natcasesort($files);
440
                foreach ($files as $file) {
440
                foreach ($files as $file) {
441
                        $realfile = self::realname($file);
441
                        $realfile = self::realname($file);
442
                        if ((substr($file,-4,4) == '.url') || (substr($file,-5,5) == '.link')) {
442
                        if ((substr($file,-4,4) == '.url') || (substr($file,-5,5) == '.link')) {
443
                                $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_leaf_url&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
443
                                $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=leaf_url_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
444
                                /*
444
                                /*
445
                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
445
                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
446
                                if (file_exists($icon_candidate)) {
446
                                if (file_exists($icon_candidate)) {
447
                                        $tree_icon = $icon_candidate;
447
                                        $tree_icon = $icon_candidate;
448
                                } else if (file_exists(__DIR__.'/treeicon_leaf_url.png')) {
448
                                } else if (file_exists(__DIR__.'/img/leaf_url_icon16.png')) {
449
                                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon_leaf_url.png';
449
                                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/leaf_url_icon16.png';
450
                                } else {
450
                                } else {
451
                                        $tree_icon = null; // default icon (folder)
451
                                        $tree_icon = null; // default icon (folder)
452
                                }
452
                                }
453
                                */
453
                                */
454
 
454
 
Line 462... Line 462...
462
                                                'href' => self::getHyperlinkURL($realfile),
462
                                                'href' => self::getHyperlinkURL($realfile),
463
                                                'target' => '_blank'
463
                                                'target' => '_blank'
464
                                        )
464
                                        )
465
                                );
465
                                );
466
                        } else {
466
                        } else {
467
                                $tree_icon = OIDplus::webpath(__DIR__).'show_icon.php?mode=treeicon_leaf_doc&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
467
                                $tree_icon = OIDplus::webpath(__DIR__,true).'show_icon.php?mode=leaf_doc_icon16&lang='.OIDplus::getCurrentLang().'&file='.urlencode($file);
468
                                /*
468
                                /*
469
                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
469
                                $icon_candidate = pathinfo($realfile)['dirname'].'/'.pathinfo($realfile)['filename'].'_tree.png';
470
                                if (file_exists($icon_candidate)) {
470
                                if (file_exists($icon_candidate)) {
471
                                        $tree_icon = $icon_candidate;
471
                                        $tree_icon = $icon_candidate;
472
                                } else if (file_exists(__DIR__.'/treeicon_leaf_doc.png')) {
472
                                } else if (file_exists(__DIR__.'/img/leaf_doc_icon16.png')) {
473
                                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon_leaf_doc.png';
473
                                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/leaf_doc_icon16.png';
474
                                } else {
474
                                } else {
475
                                        $tree_icon = null; // default icon (folder)
475
                                        $tree_icon = null; // default icon (folder)
476
                                }
476
                                }
477
                                */
477
                                */
478
                                $children[] = array(
478
                                $children[] = array(
Line 506... Line 506...
506
                $children = array();
506
                $children = array();
507
 
507
 
508
                $this->tree_rec($children, '/');
508
                $this->tree_rec($children, '/');
509
 
509
 
510
                if (!OIDplus::config()->getValue('resource_plugin_hide_empty_path', true) || (count($children) > 0)) {
510
                if (!OIDplus::config()->getValue('resource_plugin_hide_empty_path', true) || (count($children) > 0)) {
511
                        if (file_exists(__DIR__.'/treeicon.png')) {
511
                        if (file_exists(__DIR__.'/img/main_icon16.png')) {
512
                                $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
512
                                $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
513
                        } else {
513
                        } else {
514
                                $tree_icon = null; // default icon (folder)
514
                                $tree_icon = null; // default icon (folder)
515
                        }
515
                        }
516
 
516
 
517
                        $json[] = array(
517
                        $json[] = array(