@@ -26,37 +26,47 @@ class LfmController extends Controller {
26
26
*/
27
27
public function __construct ()
28
28
{
29
- $ this ->setFilePath ();
30
-
31
- $ this ->setDirPath ();
29
+ $ this ->setPathAndType ();
32
30
33
31
$ this ->checkMyFolderExists ();
34
32
35
33
$ this ->checkSharedFolderExists ();
36
34
}
37
35
38
36
37
+ /**
38
+ * Show the filemanager
39
+ *
40
+ * @return mixed
41
+ */
42
+ public function show ()
43
+ {
44
+ if (Input::has ('working_dir ' )) {
45
+ $ working_dir = Input::get ('working_dir ' );
46
+ } else {
47
+ $ working_dir = '/ ' ;
48
+ }
49
+
50
+ return View::make ('laravel-filemanager::index ' )
51
+ ->with ('working_dir ' , $ working_dir );
52
+ }
53
+
54
+
39
55
/*****************************
40
56
*** Private Functions ***
41
57
*****************************/
42
58
43
59
44
- private function setFilePath ()
45
- {
46
- if ((Session::has ('lfm_type ' )) && (Session::get ('lfm_type ' ) == 'Files ' )) {
60
+ private function setPathAndType ()
61
+ {
62
+ if (Input::has ('type ' ) && Input::get ('type ' ) === 'Files ' ) {
63
+ Session::put ('lfm_type ' , 'Files ' );
47
64
$ this ->file_location = Config::get ('lfm.files_dir ' );
65
+ $ this ->dir_location = Config::get ('lfm.files_url ' );
48
66
} else {
67
+ Session::put ('lfm_type ' , 'Images ' );
49
68
$ this ->file_location = Config::get ('lfm.images_dir ' );
50
- }
51
- }
52
-
53
-
54
- private function setDirPath ()
55
- {
56
- if ((Session::has ('lfm_type ' )) && (Session::get ('lfm_type ' ) == "Images " )) {
57
69
$ this ->dir_location = Config::get ('lfm.images_url ' );
58
- } else {
59
- $ this ->dir_location = Config::get ('lfm.files_url ' );
60
70
}
61
71
}
62
72
@@ -151,29 +161,4 @@ public function getFileName($file)
151
161
152
162
return $ filename ;
153
163
}
154
-
155
-
156
- /**
157
- * Show the filemanager
158
- *
159
- * @return mixed
160
- */
161
- public function show ()
162
- {
163
- if ((Input::has ('type ' )) && (Input::get ('type ' ) == "Files " )) {
164
- Session::put ('lfm_type ' , 'Files ' );
165
- } else {
166
- Session::put ('lfm_type ' , 'Images ' );
167
- }
168
-
169
- if (Input::has ('working_dir ' )) {
170
- $ working_dir = Input::get ('working_dir ' );
171
- } else {
172
- $ working_dir = '/ ' ;
173
- }
174
-
175
- return View::make ('laravel-filemanager::index ' )
176
- ->with ('working_dir ' , $ working_dir );
177
- }
178
-
179
164
}
0 commit comments