1: | <?php
|
2: | namespace Opencart\Admin\Controller\Startup;
|
3: | |
4: | |
5: | |
6: | |
7: |
|
8: | class Extension extends \Opencart\System\Engine\Controller {
|
9: | |
10: | |
11: | |
12: | |
13: |
|
14: | public function index(): void {
|
15: |
|
16: | $this->load->model('setting/extension');
|
17: |
|
18: | $results = $this->model_setting_extension->getInstalls();
|
19: |
|
20: | foreach ($results as $result) {
|
21: | $extension = str_replace(['_', '/'], ['', '\\'], ucwords($result['code'], '_/'));
|
22: |
|
23: |
|
24: | $this->autoloader->register('Opencart\Admin\Controller\Extension\\' . $extension, DIR_EXTENSION . $result['code'] . '/admin/controller/');
|
25: | $this->autoloader->register('Opencart\Admin\Model\Extension\\' . $extension, DIR_EXTENSION . $result['code'] . '/admin/model/');
|
26: | $this->autoloader->register('Opencart\System\Library\Extension\\' . $extension, DIR_EXTENSION . $result['code'] . '/system/library/');
|
27: |
|
28: |
|
29: | $this->template->addPath('extension/' . $result['code'], DIR_EXTENSION . $result['code'] . '/admin/view/template/');
|
30: |
|
31: |
|
32: | $this->language->addPath('extension/' . $result['code'], DIR_EXTENSION . $result['code'] . '/admin/language/');
|
33: |
|
34: |
|
35: | $this->config->addPath('extension/' . $result['code'], DIR_EXTENSION . $result['code'] . '/system/config/');
|
36: | }
|
37: |
|
38: |
|
39: | $this->autoloader->register('Opencart\Admin\Controller\Extension\Ocmod', DIR_EXTENSION . 'ocmod/admin/controller/');
|
40: | $this->autoloader->register('Opencart\Admin\Model\Extension\Ocmod', DIR_EXTENSION . 'ocmod/admin/model/');
|
41: | $this->autoloader->register('Opencart\System\Library\Extension\Ocmod', DIR_EXTENSION . 'ocmod/system/library/');
|
42: | $this->template->addPath('extension/ocmod', DIR_EXTENSION . 'ocmod/admin/view/template/');
|
43: | $this->language->addPath('extension/ocmod', DIR_EXTENSION . 'ocmod/admin/language/');
|
44: | $this->config->addPath('extension/ocmod', DIR_EXTENSION . 'ocmod/system/config/');
|
45: | }
|
46: | }
|
47: | |