@@ -32,7 +32,16 @@ private function createUrl ($url) {
32
32
public function index () {
33
33
$ this ->load ->language ('extension/module/foc_carousel ' );
34
34
$ this ->load ->model ('localisation/language ' );
35
- $ this ->load ->model ('extension/module ' );
35
+
36
+ if ($ this ->isOpencart3 ()) {
37
+ $ this ->load ->model ('setting/module ' );
38
+ $ moduleModel = $ this ->model_setting_module ;
39
+ }
40
+ else {
41
+ $ this ->load ->model ('extension/module ' );
42
+ $ moduleModel = $ this ->model_extension_module ;
43
+ }
44
+
36
45
$ this ->load ->model ('tool/image ' );
37
46
38
47
$ this ->document ->addStyle ('view/javascript/jquery/jquery-ui/jquery-ui.min.css ' );
@@ -51,24 +60,29 @@ public function index () {
51
60
$ post ['foc_carousel ' ] = $ carousel ;
52
61
53
62
if (!isset ($ this ->request ->get ['module_id ' ])) {
54
- $ this -> model_extension_module ->addModule ('foc_carousel ' , $ post );
63
+ $ moduleModel ->addModule ('foc_carousel ' , $ post );
55
64
} else {
56
- $ this -> model_extension_module ->editModule ($ this ->request ->get ['module_id ' ], $ post );
65
+ $ moduleModel ->editModule ($ this ->request ->get ['module_id ' ], $ post );
57
66
}
58
67
59
68
$ this ->session ->data ['success ' ] = $ this ->language ->get ('text_success ' );
60
69
61
- $ this ->response ->redirect ($ this ->url ->link ('extension/extension ' , 'token= ' . $ this ->session ->data ['token ' ] . '&type=module ' , true ));
70
+ if ($ this ->isOpencart3 ()) {
71
+ $ this ->response ->redirect ($ this ->url ->link ('marketplace/extension ' , $ this ->getTokenParam () . '&type=module ' , true ));
72
+ }
73
+ else {
74
+ $ this ->response ->redirect ($ this ->url ->link ('extension/extension ' , $ this ->getTokenParam () . '&type=module ' , true ));
75
+ }
62
76
}
63
77
64
78
if (!isset ($ this ->request ->get ['module_id ' ])) {
65
- $ data ['action ' ] = $ this ->url ->link ('extension/module/carousel ' , ' token= ' . $ this ->session -> data [ ' token ' ] , true );
79
+ $ data ['action ' ] = $ this ->url ->link ('extension/module/foc_carousel ' , $ this ->getTokenParam () , true );
66
80
} else {
67
- $ data ['action ' ] = $ this ->url ->link ('extension/module/carousel ' , ' token= ' . $ this ->session -> data [ ' token ' ] . '&module_id= ' . $ this ->request ->get ['module_id ' ], true );
81
+ $ data ['action ' ] = $ this ->url ->link ('extension/module/foc_carousel ' , $ this ->getTokenParam () . '&module_id= ' . $ this ->request ->get ['module_id ' ], true );
68
82
}
69
83
70
84
if (isset ($ this ->request ->get ['module_id ' ]) && ($ this ->request ->server ['REQUEST_METHOD ' ] != 'POST ' )) {
71
- $ module_info = $ this -> model_extension_module ->getModule ($ this ->request ->get ['module_id ' ]);
85
+ $ module_info = $ moduleModel ->getModule ($ this ->request ->get ['module_id ' ]);
72
86
}
73
87
74
88
if (isset ($ this ->request ->post ['name ' ])) {
@@ -147,8 +161,6 @@ public function index () {
147
161
}
148
162
}
149
163
150
-
151
-
152
164
$ data ['heading_title ' ] = $ this ->language ->get ('heading_title ' );
153
165
$ data ['breadcrumbs ' ] = $ this ->breadcrumbs ();
154
166
$ data ['header ' ] = $ this ->load ->controller ('common/header ' );
@@ -198,7 +210,7 @@ private function breadcrumbs () {
198
210
);
199
211
$ breadcrumbs [] = array (
200
212
'text ' => $ this ->language ->get ('text_extension ' ),
201
- 'href ' => $ this ->createUrl ('extension/extension ' ),
213
+ 'href ' => $ this ->isOpencart3 () ? $ this -> createUrl ( ' marketplace/extension ' ) : $ this -> createUrl ('extension/extension ' ),
202
214
'separator ' => ' :: '
203
215
);
204
216
$ breadcrumbs [] = array (
0 commit comments