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