|
20 | 20 |
|
21 | 21 | namespace PrestaShop\Module\Ps_Googleanalytics\Form; |
22 | 22 |
|
23 | | -use AdminController; |
24 | 23 | use Configuration; |
25 | 24 | use Context; |
26 | 25 | use HelperForm; |
@@ -53,25 +52,33 @@ public function generate() |
53 | 52 | $helper->module = $this->module; |
54 | 53 | $helper->name_controller = $this->module->name; |
55 | 54 | $helper->token = Tools::getAdminTokenLite('AdminModules'); |
56 | | - $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->module->name; |
| 55 | + $helper->currentIndex = Context::getContext()->link->getAdminLink('AdminModules', true, [], [ |
| 56 | + 'configure' => $this->module->name, |
| 57 | + 'tab_module' => $this->module->tab, |
| 58 | + 'module_name' => $this->module->name, |
| 59 | + ]); |
57 | 60 |
|
58 | 61 | // Language |
59 | 62 | $helper->default_form_language = $default_lang; |
60 | 63 | $helper->allow_employee_form_lang = $default_lang; |
61 | 64 |
|
62 | 65 | // Title and toolbar |
63 | 66 | $helper->title = $this->module->displayName; |
64 | | - $helper->show_toolbar = true; // false -> remove toolbar |
65 | | - $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. |
| 67 | + $helper->show_toolbar = true; // false -> remove toolbar |
| 68 | + $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. |
66 | 69 | $helper->submit_action = 'submit' . $this->module->name; |
67 | 70 | $helper->toolbar_btn = [ |
68 | 71 | 'save' => [ |
69 | 72 | 'desc' => $this->module->getTranslator()->trans('Save', [], 'Modules.Googleanalytics.Admin'), |
70 | | - 'href' => AdminController::$currentIndex . '&configure=' . $this->module->name . '&save=' . $this->module->name . |
71 | | - '&token=' . $helper->token, |
| 73 | + 'href' => Context::getContext()->link->getAdminLink('AdminModules', true, [], [ |
| 74 | + 'configure' => $this->module->name, |
| 75 | + 'tab_module' => $this->module->tab, |
| 76 | + 'module_name' => $this->module->name, |
| 77 | + 'save' => $this->module->name, |
| 78 | + ]), |
72 | 79 | ], |
73 | 80 | 'back' => [ |
74 | | - 'href' => AdminController::$currentIndex . '&token=' . $helper->token, |
| 81 | + 'href' => Context::getContext()->link->getAdminLink('AdminModules', true), |
75 | 82 | 'desc' => $this->module->getTranslator()->trans('Back to list', [], 'Modules.Googleanalytics.Admin'), |
76 | 83 | ], |
77 | 84 | ]; |
|
0 commit comments