1: | <?php
2: | namespace Opencart\Catalog\Controller\Event;
3: | /**
4: | * Class Modification
5: | *
6: | * @package Opencart\Catalog\Controller\Event
7: | */
8: | class Modification extends \Opencart\System\Engine\Controller {
9: | /**
10: | * Controller
11: | *
12: | * @param string $route
13: | * @param array<int, mixed> $args
14: | *
15: | * @return void
16: | */
17: | public function controller(string &$route, array &$args): void {
18: | if (substr($route, 0, 16) !== 'extension/ocmod/' && is_file(DIR_EXTENSION . 'ocmod/catalog/controller/' . $route . '.php')) {
19: | $route = 'extension/ocmod/' . $route;
20: | }
21: | }
22: |
23: | /**
24: | * Model
25: | *
26: | * @param string $route
27: | * @param array<int, mixed> $args
28: | *
29: | * @return void
30: | */
31: | public function model(string &$route, array &$args): void {
32: | // For all models we need to separate the method which will always the last /
33: | $pos = strrpos($route, '/');
34: |
35: | $class = substr($route, 0, $pos);
36: |
37: | if (substr($route, 0, 16) !== 'extension/ocmod/' && is_file(DIR_EXTENSION . 'ocmod/catalog/model/' . $class . '.php')) {
38: | $route = 'extension/ocmod/' . $class . '/' . substr($route, $pos + 1);
39: | }
40: | }
41: |
42: | /**
43: | * View
44: | *
45: | * @param string $route
46: | * @param array<int, mixed> $args
47: | *
48: | * @return void
49: | */
50: | public function view(string &$route, array &$args): void {
51: | if (substr($route, 0, 16) !== 'extension/ocmod/' && is_file(DIR_EXTENSION . 'ocmod/admin/view/template/' . $route . '.twig')) {
52: | $route = 'extension/ocmod/' . $route;
53: | }
54: | }
55: |
56: | /**
57: | * Library
58: | *
59: | * @param string $route
60: | * @param array<int, mixed> $args
61: | *
62: | * @return void
63: | */
64: | public function library(string &$route, array &$args): void {
65: | if (substr($route, 0, 16) !== 'extension/ocmod/' && is_file(DIR_EXTENSION . 'ocmod/system/library/' . $route . '.php')) {
66: | $route = 'extension/ocmod/' . $route;
67: | }
68: | }
69: | }
70: |

OpenCart API API documentation generated by ApiGen dev-master