@@ -25,13 +25,18 @@ class Filemanager {
25
25
protected $ logger = false ;
26
26
protected $ logfile = '/tmp/filemanager.log ' ;
27
27
28
- public function __construct () {
28
+ public function __construct ($ config = '' ) {
29
29
30
30
$ content = file_get_contents ("../../scripts/filemanager.config.js " );
31
31
$ config = json_decode ($ content , true );
32
32
33
33
$ this ->config = $ config ;
34
34
35
+ // override config options if needed
36
+ if (!empty ($ config )) {
37
+ $ this ->setup ($ config );
38
+ }
39
+
35
40
$ this ->root = dirname (dirname (dirname (__FILE__ ))).DIRECTORY_SEPARATOR ;
36
41
$ this ->properties = array (
37
42
'Date Created ' =>null ,
@@ -62,6 +67,13 @@ public function __construct() {
62
67
$ this ->availableLanguages ();
63
68
$ this ->loadLanguageFile ();
64
69
}
70
+
71
+ // $extraconfig should be formatted as json config array.
72
+ public function setup ($ extraconfig ) {
73
+
74
+ $ this ->config = array_merge ($ this ->config , $ extraconfig );
75
+
76
+ }
65
77
66
78
public function error ($ string ,$ textarea =false ) {
67
79
$ array = array (
@@ -491,8 +503,6 @@ private function getFullPath($path = '') {
491
503
if ($ path == '' ) {
492
504
$ path = $ this ->get ['path ' ];
493
505
}
494
-
495
- // $this->__log('getCurrentPath : $this->doc_root ' .$this->doc_root. ' $this->get[path] : ' . $path . '');
496
506
497
507
if ($ this ->config ['options ' ]['fileRoot ' ] !== false ) {
498
508
$ full_path = $ this ->doc_root . rawurldecode (str_replace ( $ this ->doc_root , '' , $ path ));
0 commit comments