| @@ 49-55 (lines=7) @@ | ||
| 46 | ||
| 47 | $dirnames = XoopsLists::getDirListAsArray($helper->path('decorators/'), ''); |
|
| 48 | foreach ($dirnames as $dirname) { |
|
| 49 | if (XoopsLoad::loadFile($helper->path("decorators/{$dirname}/decorator.php"))) { |
|
| 50 | $className = 'Menus' . ucfirst($dirname) . 'Decorator'; |
|
| 51 | $class = new $className($dirname); |
|
| 52 | if ($class instanceof MenusDecoratorAbstract && $class instanceof MenusDecoratorInterface) { |
|
| 53 | $decorators[$dirname] = $class; |
|
| 54 | } |
|
| 55 | } |
|
| 56 | } |
|
| 57 | } |
|
| 58 | return $decorators; |
|
| @@ 33-42 (lines=10) @@ | ||
| 30 | foreach ($dirNames as $listener) { |
|
| 31 | foreach ($dirNames as $caller) { |
|
| 32 | //Make sure to load the interface |
|
| 33 | if (\XoopsLoad::loadFile($xoops->path("modules/{$caller}/class/plugin/interface.php"))) { |
|
| 34 | if (\XoopsLoad::loadFile($xoops->path("modules/{$listener}/class/plugin/{$caller}.php"))) { |
|
| 35 | $interfaceName = '\\' . ucfirst($caller) . "PluginInterface"; |
|
| 36 | if ($ref = new ReflectionClass($interfaceName)) { |
|
| 37 | if ($ref->implementsInterface($interfaceName)) { |
|
| 38 | $listeners[$listener][] = $caller; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | } |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| 45 | } |
|